Upstream Timed Out Errors

Hello all ,

Centos 5 64bit with nginx+php-cgi . Worker processes 4,active php-cgi
limit 100 and i am getting that error time to time. While err time CPU
loads high and http gives 404. I am willing to pay for a good
configuration or donate for this project if i can get real help.

Err types:

upstream prematurely closed connection while reading response header from upstream
upstream timed out (110: Connection timed out) while connecting to upstream

Hardware:
q6600 , 4 gb ram , rai0 with 5 hq disk

Software:
nginx/0.5.34 | PHP 5.2.4 | PHP 5.1.6 (cgi-fcgi) | Zend Engine v2.1.0 |
Mysql 5.0.22 | Kernel 2.6.18-53.1.4.el5

I cant find any solution , why i am getting that err time to time . Is
it a bug?

Willing to get answer , thank you.

upstream timed out (110: Connection timed out) while connecting to upstream

Your upstream (backend) simply and just does not cope with a load.
The problem is there, not in nginx.

You may make nginx waiting longer, add sth like

fastcgi_read_timeout 180;

to your config (default is 60 seconds). Especially do it in case
you have long-lasting operations which may normally take so long.

And consider backend tuning. Maybe you need more fastcgi processess,
maybe some database look, maybe more iron…

Marcin K. wrote:

upstream timed out (110: Connection timed out) while connecting to upstream

Your upstream (backend) simply and just does not cope with a load.
The problem is there, not in nginx.

You may make nginx waiting longer, add sth like

fastcgi_read_timeout 180;

to your config (default is 60 seconds). Especially do it in case
you have long-lasting operations which may normally take so long.

And consider backend tuning. Maybe you need more fastcgi processess,
maybe some database look, maybe more iron…

how did you configure nginx to work on the 64bit centos? i get some
errors while compiling