[uWSGI] uwsgi does not flush output

Chan Guan Hao guanhao3797 at gmail.com
Thu Mar 3 17:15:28 CET 2016

I'm not sure how I can explain this better. But shows what I'm

This URL sends JSON over and I have verified that the WSGI function runs
without exceptions and returns the complete payload. But somehow it still
continuously loads, without sending over the full payload.

However, when I am running it myself manually, and when I stop the uwsgi
instance with CTRL-C, the output gets flushed out to the browser. So I have
a gut feeling that it's uwsgi that's not closing a connection or something.

This is the uwsgi log:
`[pid: 4020|app: 0|req: 1/3] () {44 vars in 838 bytes} [Thu
Mar  3 10:53:08 2016] GET /api/search/?keyword=headphones&page=1 =>
generated 19103 bytes in 4244 msecs (HTTP/1.1 200) 2 headers in 74 bytes (1
switches on core 0)`

This is the nginx log:
`2016/03/03 10:45:29 [error] 907#0: *321 upstream timed out (110:
Connection timed out) while reading upstream, client:,
server:, request: "GET
/api/search/?keyword=headphones&page=1 HTTP/1.1", upstream: "uwsgi://", host: ""`

After seeing this in the nginx log, I was sure that nginx was not the
culprit in the infinite loading issue because it was expecting uwsgi to
close the connection.

My uwsgi configuration:

module = app
callable = app
master = true
processes = 5
vacuum = true
socket =
die-on-term = true
log-to = /root/cheapchirp/logs/server.log
pyhome = /root/cheapchirp/env

Extra details: Flask, Python 2.7.6
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.unbit.it/pipermail/uwsgi/attachments/20160304/4cae32f3/attachment.html>

More information about the uWSGI mailing list