0.5.7 waiting connections

Jan Ślusarczyk jan.slusarczyk at dobrestrony.pl
Fri Jan 19 03:27:20 MSK 2007


Hi,

I am currently using nginx to serve static files and proxy the rest  
of requests (mostly php) to apache on another private IP on the same  
machine. Everything seems to be running great but one thing. The  
number of "waiting" connections (watched by status_stub) is  
constantly rising. The server is not very busy with approx 20 req/sec  
and the waiting connections numbers goes up to 1.800 connections in  
approx. 20 hours. I have browsed the archives searching for clues and  
found the undocumented directive reset_timedout_connection. I have  
turned this on - but it didn't help. My configuration is below.

The server is dual Xeon HT, 4GB ram, Linux. Apache behind the proxy  
is 2.0.53 with mod_php running VBulletin and Typo3.

Any help and hints will be very appreciated. Cheers
Jan Ślusarczyk

Here's my setup:

worker_processes  4;

error_log  /var/log/nginx/error.log;

events {
     worker_connections  1024;
}

http {
     include       /etc/nginx/mime.types;
     default_type  application/octet-stream;
     sendfile        on;
     #tcp_nopush     on;
     #keepalive_timeout  0;
     keepalive_timeout  15;
	reset_timedout_connection  on;
     tcp_nodelay        on;
	server_names_hash_bucket_size 64;

	upstream apache {
         server 192.168.3.189:80;
     }

     gzip on;
     gzip_min_length  1100;
     gzip_buffers     4 8k;
     gzip_types       text/plain;

     include         /etc/nginx/vhosts/*.conf;
}

proxy.conf:

             proxy_redirect     off;
			proxy_buffering off; #+
			
             proxy_set_header   Host             $host;
             proxy_set_header   X-Real-IP        $remote_addr;
             proxy_set_header   X-Forwarded-For   
$proxy_add_x_forwarded_for;


sample vhost from include:

server {
     listen        192.168.3.89:80;
     server_name  puszcza.dobrestrony.pl;
     access_log  /var/log/nginx/puszcza.dobrestrony.pl.access.log   
combined;
     # statyka
	location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc| 
xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$ {
             root  /var/www/hosts/puszcza.dobrestrony.pl;
             expires 1d;
     }
     location / {
         proxy_pass      http://apache;
         include         /etc/nginx/proxy.conf;
     }
}









More information about the nginx mailing list