FastCGI upstream timeout question

I have switched around my architecture now, and I have one nginx
server that is serving up all static content and proxying FastCGI
(php) stuff to one of three servers that are basically just running
PHP-FPM.

I have a website that allows for large file uploads - I just tried
uploading a 160 meg file, and it chugged along all the way until the
end, then I got this:

2009/10/13 22:23:46 [error] 28261#0: *3157128 upstream timed out (110:
Connection timed out) while sending request to upstream, client:
1.2.131.200, server: foo.com, request: “POST /user/swfupload/put.php
HTTP/1.1”, upstream: “fastcgi://10.13.220.84:11011”, host: “foo.com

I did receive only one other message, but I don’t think this should
really matter. This occurred very early on in the process.

2009/10/13 21:24:11 [warn] 28261#0: *3157128 a client request body is
buffered to a temporary file /var/lib/nginx/body/0000000400, client:
1.2.131.200, server: foo.com, request: “POST /user/swfupload/put.php
HTTP/1.1”, host: “foo.com

Do I need to set some insanely large timeouts on the nginx side so
that it keeps the request open for the entire file upload? It took at
least 20-25 minutes. I don’t see why I would get a timeout right when
it was done unless the server needed to be told to keep the connection
alive the entire time?

Here’s any possible relevant nginx config stuff:

worker_processes 2;
worker_cpu_affinity 0001 0010;
worker_rlimit_nofile 131072;

events {
use epoll;
worker_connections 32768;
}

fastcgi_buffers 32 8k;
fastcgi_buffer_size 8k;
fastcgi_busy_buffers_size 16k;
fastcgi_cache off;
fastcgi_ignore_client_abort on;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_read_timeout 120;

    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    ignore_invalid_headers on;
    client_max_body_size 251m;
    client_header_buffer_size 8k;

    client_body_buffer_size 416k;
    large_client_header_buffers 16 8k;
    keepalive_timeout 30;

    proxy_buffer_size 16k;
    proxy_buffers 16 8k;

This is on Linux (Ubuntu Jaunty) all up to date…

nginx -V

nginx version: nginx/0.8.19
built by gcc 4.3.3 (Ubuntu 4.3.3-5ubuntu4)
configure arguments: --conf-path=/etc/nginx/nginx.conf --prefix=/usr
–user=www-data --group=www-data
–error-log-path=/var/log/nginx/error.log
–pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock
–http-log-path=/var/log/nginx/access.log
–http-client-body-temp-path=/var/lib/nginx/body
–http-proxy-temp-path=/var/lib/nginx/proxy
–http-fastcgi-temp-path=/var/lib/nginx/fastcgi
–with-http_stub_status_module --with-http_gzip_static_module
–without-mail_pop3_module --without-mail_smtp_module
–without-mail_imap_module --with-http_flv_module
–with-http_ssl_module --with-http_dav_module
–with-http_realip_module --with-http_xslt_module --with-debug

Any ideas? Thanks.

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