Jump to content

Nginx + php-fpm Slow Response When Busy


godius

Recommended Posts

Hello im running a quad core 8GB machine with fast scsi drives with 64bit centos 5.

 

Now on that site i run a site that get about 750.000 unique visitors, and the site uses ajax intensively. every pageview uses about 15 ajax http requests. I used to run my site on apache, but because of the insanely high load i decided to move to nginx.

 

I have setup nginx with php-fpm, and it is running quite good, only when it gets really busy (around 25 pageviews per second), i sometimes notice that i have to wait a few seconds before the server sends a response. This only happens when its busy, so i think ive hit some kind of limit in nginx. It is probably possible to resolve this by changing a certain value somewhere.

 

The server load is always low, around 1. Below i have posted some of the settings i have already modified.

 

[b]nginx.conf[/b]
events {
    worker_connections  6000;
}
worker_processes  12;
sendfile            on;
tcp_nopush          on;
tcp_nodelay         on;
keepalive_timeout   10;
gzip            on;
gzip_comp_level 2;
gzip_proxied    any;
gzip_types    text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

 

 

[b]php-fpm.conf[/b]
<value name="max_children">3000</value>
<value name="StartServers">200</value>
<value name="MinSpareServers">600</value>
<value name="MaxSpareServers">2000</value>
<value name="request_terminate_timeout">10s</value>

 

before on apache my site used to get busier because it was able to handle up to 35 pageviews per second, now i never see it go over 25, because i think nginx can not handle more with my current setup.

 

Please advice how to tune/optimize/improve my settings.

 

Kind regards,

 

Godius

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.