# Hightraffic php site problems

**URL:** <https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378>\
**Category:** NGINX\
**Created:** [July 29, 2010, 11:33am UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378 "2010-07-29T11:33:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 29, 2010, 11:33am UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/1 "2010-07-29T11:33:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 29, 2010, 11:39am UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/2 "2010-07-29T11:39:14Z")

</div>

Hi,

> ```
> fastcgi_connect_timeout 90;
> fastcgi_send_timeout 90;
> fastcgi_read_timeout 90;
> 
> ```

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

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 29, 2010, 11:42am UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/3 "2010-07-29T11:42:45Z")

</div>

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 😉

No, these are seconds. “fastcgi\_connect\_timeout 90ms” is in  
milliseconds.

–  
Igor S.

> **[Igor Sysoev](http://sysoev.ru/en/)**

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 29, 2010, 2:06pm UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/4 "2010-07-29T14:06:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 29, 2010, 2:57pm UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/5 "2010-07-29T14:57:41Z")

</div>

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 🙂

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 30, 2010, 5:13am UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/6 "2010-07-30T05:13:33Z")

</div>

On Thu, Jul 29, 2010 at 8:57 PM, Juergen G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
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

---

<div class="post-metadata">

**Author:** ![gromminger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a4c791/32.png) [@gromminger](https://www.ruby-forum.com/u/gromminger)\
**Post date:** [July 29, 2010, 1:34pm UTC](https://www.ruby-forum.com/t/hightraffic-php-site-problems/192378/7 "2010-07-29T13:34:33Z")

</div>

Hi,

> No, these are seconds. “fastcgi\_connect\_timeout 90ms” is in milliseconds.

Indeed, I guess that “ngx\_conf\_set\_msec\_slot” confused me 😉  
Sorry for the noise.

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>
