Upstream timed out (110: Connection timed out)

I installed on Debian Lenny nginx 0.6.32 and php-fpm and php file opens
as well but went trying to do post request i get error in my
/var/log/nginx/error.log
“upstream timed out (110: Connection timed out) while reading response
header from upstream, …”
My config of host

server {
listen 80;
server_name domain.ru www.domain.ru;

set $www_folder ‘/var/www’;
set $root_path ‘$www_folder’;
root $root_path;
index index.htm index.html index.php;

location ~ .php$ {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $root_path/$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $root_path;
fastcgi_pass php-fpm;
}
location @phpscripts {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $root_path/$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $root_path;
fastcgi_pass php-fpm;
}

location / {
default_type text/html;
root $root_path;

 if (!-e $request_filename) {
    return 404;
 }

 error_page      404 502 504 403 405 = @php;

}

location @php {
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $root_path/index.php;
fastcgi_pass php-fpm;
}

error_page 502 = /502.htm;
location = /502.htm {
root $www_folder;
}

location ~* .(css|js|swf|ico|png|jpg|gif|jpeg|mp3|xml|html)$ {
root $root_path;
access_log off;
expires 30d;
}

location ~ /.ht {
deny all;
}

location ~ /.svn/ {
deny all;
}

}

and my /etc/nginx/nginx.conf

worker_processes 6;

worker_priority -1;

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

events {
worker_connections 5024;
# multi_accept on;
}

http {
include /etc/nginx/mime.types;

access_log  /var/log/nginx/access.log;

sendfile        on;
#tcp_nopush     on;

#keepalive_timeout  0;
keepalive_timeout  65;
tcp_nodelay        on;

gzip  on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

    # PHP-FPM (backend)
    upstream php-fpm {
       server 127.0.0.1:9000;
    }


include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}

size of post requst is not large, it’s couple kb.
php script is login form.
so post request handles very slow.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,215447,215448#msg-215448

php script is login form.
so post request handles very slow.

What does the php-fpm log show?

If its not enabled see where is your ‘php-fpm.conf’ is and under:

[global]
error_log = /path/to/your/php-fpm.log
slowlog = /path/to/your/slow.log

Optionaly (if not present) add something like:

request_slowlog_timeout = 10s

(it will log/backtrace all php requests which take longer than 10
seconds).

rr

Optionaly (if not present) add something like:
request_slowlog_timeout = 10s

Of course after the changes restart php-fpm.

rr

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs