File download results in "110: Connection timed out" on nginx; Download continues until Linux Kernel 'tcp_fin_timeout' reached

Tolga Ceylan tolga.ceylan at gmail.com
Sat Jan 30 05:23:37 UTC 2016


This looks normal. Definition of 'send_timeout' is in:

http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout

"Sets a timeout for transmitting a response to the client. The timeout
is set only between two successive write operations, not for the
transmission of the whole response. If the client does not receive
anything within this time, the connection is closed."

Here the tricky part is "write operations" phrase. In your config (and
from your logs), I see that you are using "sendfile" which is a single
write operation for static files from nginx perspective. With
4000/sec, it'll take 34 minutes for the download (8MB) to complete, so
send timeout fires.

Cheers,
Tolga



More information about the nginx mailing list