Hello,
I am running nginx + uwsgi 1.9.20
config is look like this:
max-requests = 100
enable-threads = true
static-offload-to-thread = 3
static-map = /data/=/data/
log-5xx = true
log-4xx = true
log-slow = true
log-big = true
log-sendfileg = true
log-microsg = true
log-x-forwarded-forg = true
So we are using uwsgi's static file serving capability. But recently we had
a problem, whenever someone tries a download it fails after only a few
bytes. The log shows this:
Mon Dec 2 20:57:14 2013 - SIGPIPE: writing to a closed pipe/socket/fd
(probably the client disconnected) on request /data/1.zip (ip 10.0.18.2) !!!
uwsgi_response_sendfile_do(): Broken pipe [core/writer.c line 394]
[pid: 12153|app: -1|req: -1/11] 10.0.18.2 () {38 vars in 674 bytes} [Mon
Dec 2 20:57:14 2013] GET /data/1.zip => generated 0 bytes in 10 msecs via
sendfile() (HTTP/1.1 200) 3 headers in 122 bytes (1 switches on core 0)
^C
$ ^C
$ sudo strace -p 12153 -s 1024
Process 12153 attached - interrupt to quit
epoll_wait(4,
{{EPOLLIN, {u32=3, u64=3}}}, 1, 4294967295) = 1
accept4(3, {sa_family=AF_FILE, NULL}, [2], SOCK_NONBLOCK) = 6
read(6,
"\0\242\2\0\f\0QUERY_STRING\0\0\16\0REQUEST_METHOD\3\0GET\f\0CONTENT_TYPE\0\0\16\0CONTENT_LENGTH\0\0\v\0REQUEST_URI\v\0/data/1.zip\t\0PATH_INFO\v\0/data/1.zip\r\0DOCUMENT_ROOT\20\0/etc/nginx//html\17\0SERVER_PROTOCOL\10\0HTTP/1.1\v\0REMOTE_ADDR\t\00010.0.18.2\v\0REMOTE_PORT\5\00064703\v\0SERVER_PORT\2\00080\v\0SERVER_NAME\f\
0xxxx.com\t\0HTTP_HOST\f\0xxxx.com\17\0HTTP_CONNECTION\n\0keep-alive\v\0HTTP_ACCEPT?\0text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\17\0HTTP_USER_AGENTl\0Mozilla/5.0
(Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko)
Chrome/26.0.1410.64
Safari/537.31\24\0HTTP_ACCEPT_ENCODING\21\0gzip,deflate,sdch\24\0HTTP_ACCEPT_LANGUAGE#\0en,en-US;q=0.8,zh;q=0.6,zh-CN;q=0.4\23\0HTTP_ACCEPT_CHARSET\27\0GBK,utf-8;q=0.7,*;q=0.3",
4100) = 678
lstat("/data", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
lstat("/data/1.zip", {st_mode=S_IFREG|0755, st_size=38681393, ...}) = 0
stat("/data/1.zip", {st_mode=S_IFREG|0755, st_size=38681393, ...}) = 0
open("/data/1.zip", O_RDONLY) = 8
write(6, "HTTP/1.1 200 OK\r\nContent-Type:
application/zip\r\nContent-Length: 38681393\r\nLast-Modified: Tue, 03 Dec
2013 02:57:02 GMT\r\n\r\n", 122) = 122
sendfile(6, 8, [0], 38681393) = 184320
poll([{fd=6, events=POLLOUT}], 1, 4000) = 1 ([{fd=6,
revents=POLLOUT|POLLERR|POLLHUP}])
sendfile(6, 8, [184320], 38497073) = -1 EPIPE (Broken pipe)
--- SIGPIPE (Broken pipe) @ 0 (0) ---
write(2, "Mon Dec 2 20:57:33 2013 - SIGPIPE: writing to a closed
pipe/socket/fd (probably the client disconnected) on request /data/1.zip
(ip 10.0.18.2) !!!\n", 148) = 148
rt_sigreturn(0x2) = -1 EPIPE (Broken pipe)
write(2, "uwsgi_response_sendfile_do(): Broken pipe [core/writer.c line
394]\n", 67) = 67
close(8) = 0
close(6) = 0
writev(2, [{"[pid: 12153|app: -1|req: -1/12] 10.0.18.2 () {38 vars in 674
bytes} [Mon Dec 2 20:57:33 2013] GET /data/1.zip => generated 0 bytes in
19 msecs via sendfile() (HTTP/1.1 200) 3 headers in 122 bytes (1 switches
on core 0)\n", 220}], 1) = 220
epoll_wait(4, ^C <unfinished ...>
Process 12153 detached
This troubled us for some time. As it turns out, our server hard disk is
full... df -h shows zero bytes left.
Hope this helps others who had the same trouble :)
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi