Hightraffic php site problems

Hi,

i got some problems with a high loaded php site running nginx + php
(without fpm).

i get the following error message from time to time:

162503979 upstream timed out (110: Connection timed out) while reading
response header from upstream,

While this occours, nginx stops delivering php content and drops the
error document.

Heres a part of my nginx conf

user webuser1 nginx;
worker_processes 4;
worker_rlimit_nofile 65000;

#error_log /var/log/nginx/error.log debug;
error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/nginx.pid;

events {
worker_connections 8192;
use epoll;
}

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

 log_format main      '$remote_addr $remote_user [$time_local]  '
                      '"$request" $status $bytes_sent '
                      '"$http_referer" "$http_user_agent" '
                      '"$gzip_ratio"';



 client_body_buffer_size   1024k;
 client_header_buffer_size 128k;
 large_client_header_buffers 16 16k;



 access_log off;
 server_tokens off;

 sendfile            on;
 tcp_nopush          on;
 tcp_nodelay         on;

 client_body_timeout   15;
 client_header_timeout 15;
 keepalive_timeout     5 15;
 send_timeout          15;

 gzip              on;
 gzip_static       on;
 gzip_buffers      16 8k;
 gzip_comp_level   5;
 gzip_http_version 1.0;
 gzip_min_length   0;
 gzip_types        text/plain text/css image/x-icon image/bmp;
 gzip_vary         on;


 output_buffers      1 64k;
 postpone_output     1460;
 client_max_body_size 8m;
 server_names_hash_bucket_size 256;

 open_file_cache          max=2000  inactive=20s;
 open_file_cache_valid    30s;
 open_file_cache_min_uses 2;
 open_file_cache_errors   on;
 fastcgi_connect_timeout 90;
 fastcgi_send_timeout 90;
 fastcgi_read_timeout 90;
 fastcgi_buffer_size 512k;
 fastcgi_buffers 8 512k;
 fastcgi_busy_buffers_size 512k;
 fastcgi_temp_file_write_size 512k;
 fastcgi_intercept_errors on;
 fastcgi_ignore_client_abort on;

 # Load config files from the /etc/nginx/conf.d directory
 include /etc/nginx/conf.d/*.conf;

}

Any Ideas how i could resolv this?

Thanks!

Juergen

Hi,

fastcgi_connect_timeout 90;
fastcgi_send_timeout 90;
fastcgi_read_timeout 90;

Those values are in milliseconds, so you should probably increase them
:wink:

Best regards,
Piotr S. < [email protected] >

On Thu, Jul 29, 2010 at 11:37:58AM +0200, Piotr S. wrote:

Hi,

fastcgi_connect_timeout 90;
fastcgi_send_timeout 90;
fastcgi_read_timeout 90;

Those values are in milliseconds, so you should probably increase them :wink:

No, these are seconds. “fastcgi_connect_timeout 90ms” is in
milliseconds.


Igor S.
http://sysoev.ru/en/

Can you provide information on your PHP set-up? Eg. how many
processes/FCGI children are running, etc?

found the problem… our customer created a cronjob which dumped the
mysql db every 2 hours. after mysqldump starts, a few secs later nginx
was in trouble.

doh. fail :slight_smile:

On Thu, Jul 29, 2010 at 8:57 PM, Juergen G. [email protected]
wrote:

found the problem… our customer created a cronjob which dumped the mysql
db every 2 hours. after mysqldump starts, a few secs later nginx was in
trouble.

Try InnoDB with mysqldump --single-transaction
It would NOT lock tables.

Ren Xiaolei

Hi,

No, these are seconds. “fastcgi_connect_timeout 90ms” is in milliseconds.

Indeed, I guess that “ngx_conf_set_msec_slot” confused me :wink:
Sorry for the noise.

Best regards,
Piotr S. < [email protected] >