Nginx slowing down...

Gen Gennix lists at ruby-forum.com
Tue Sep 23 23:53:33 MSD 2008


Hi everybody,

I have a problem...

When Nginx is reaching more than 120 requests/seconds, http connections
start to slow down (from 2 secondes to get all the home page to 20
secondes), and I don't understand why.
I though it was PHP or MySQL but even a HTTP GET on a simple image is
tragically slowing down.

Any idea?


I use with a Pentium 4 with 1GB RAM:
  . Linux    2.6.18
  . Nginx    0.6.32
  . PHP      5.2.6
  . PHP-FPM  0.5.8
  . XCache   1.2.2
  . MySQL    5.0.45


The nginx.conf:

---------------------------------------------------------------------
user              nginx nginx;
worker_processes  1;

events
{
    worker_connections  2048;
}


http
{
   include       mime.types;
   default_type  application/octet-stream;

   access_log        off;
   sendfile          on;
   tcp_nopush        on;
   tcp_nodelay       on;
   keepalive_timeout 60;

   gzip              on;

   gzip_comp_level   2;
   gzip_types        text/plain text/html text/css text/javascript;

   server
      {
         listen       80;
         server_name  www.domain.com domain.com www.domain.fr domain.fr;

         root         /home/www;

         location /
            {
               index  index.php;
               rewrite ^/?$            /index.php            last;
               rewrite ^/?index\.php$  /index.php            last;
               rewrite ^/?(.*)$        /search.php?query=$1  last;
            }

         # redirect server error pages to the static page /50x.html
         #
         error_page   500 502 503 504  /50x.html;
         location = /50x.html
            {
               root   /usr/local/nginx/html;
            }

         # PHP configuration
         location ~ .*\.php$
         {
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME
/home/www/$fastcgi_script_name;
            include        fastcgi_params;
         }


         # Static files configuration
         location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico)$
         {
            access_log        off;
            expires           30d;
         }


         location /nginx_status
         {
            stub_status  on;
            access_log   off;
            allow        my.ip.addr.ess;
            deny         all;
         }
   }
}
-- 
Posted via http://www.ruby-forum.com/.





More information about the nginx mailing list