Recently, I’ve started seeing a strange problem - sometimes it happens
that nginx only transfers only a small part of the file and the download
gets interrupted. When I debug it, the issue narrows down to “client
timed out (110: Connection timed out) while sending response to client”,
but this is certainly not the case, as it happens very quickly (almost
immediately after starting the download, in a less than a second). I
don’t see anything unusual with tcpdump. I was wondering whether some of
you has an idea what can be the root cause for this strange behaviour?
Thanks in advance.
aio on
sendfile on
directio on
tcp_nodelay off
tcp_nopush off
open_file_cache on
client_body_timeout 10
client_header_timeout 10
send_timeout 10
keepalive_timeout 30
max_ranges 5
Note that nothing happens with the connection in question between
“22:03:36” and “22:03:49”. Looks ok unless you have additional
info which suggests that data from socket buffer was sent to
the client and it’s nginx fault it doesn’t sent more data.
It’s slightly off from expected 10 seconds as per your config part
you’ve provided, though this is likely related to the fact that your
nginx processes are disk-bound and nginx wasn’t able to process
timer in time. You may want to take a look at sendfile_max_chunk
directive, see