nginx version 1.0.15 stable
im running into a problem the a 16k static file was cut off into a 2.03k
incomplete file occasionally, 7 times of 10 will get the incomplete
file.
i use the nginx server for pure static file serving
sendfile on,
tcp_nopush on,
tcp_nodelay on,
keepalive timeout 0,
gzip off
open_file_cache on
using epoll
no other configurations, what could be the problem? client body size?
A few suggestions:
1°) tcp_nodelay on; is useless, as the default
valuehttp://wiki.nginx.org/HttpCoreModule#tcp_nodelayis ‘on’ already
2°) Is tcp_nopush a really necessary option? Forcing things on packets
is
non-natural (http://wiki.nginx.org/HttpCoreModule#tcp_nopush). Maybe
problems come from that
3°) I’d suggest to test with the latest stable (1.2.1 since today).
Maybe
it won’t solve the pb but the latest binary is always a good thing to
have
problem solved:
the problem is due to that a new file (16k) replaced the old one
(2.03k), and the cache only refreshed the file content, but not the file
size, so if the file cache is not expired, client may get the right file
but the wrong size, which cause the file to be truncated.
thx B.R, again