Memory use flares up sharply, how to troubleshoot?

gthb nginx-forum at
Tue Jul 22 17:07:58 UTC 2014


> Trivial workaround is to use "uwsgi_buffers 8 64k" instead.
> Or you may try the following patch:

Thank you! I tried the uwsgi_buffers workaround in production, and the patch
in my reproduction setup, and indeed both seem to fix this problem; the
request runs to completion with no memory growth.

> - your backend app returns data in very small chunks, thus there
> are many ngx_readv_chain() calls;

That's a likely cause of high CPU usage in Nginx, right? It goes to 20% for
this one request (without debug), the Python app taking the rest. My
intuition was that joining chunks on the Python side would be much more
expensive ... but those thousands of ngx_readv_chain() calls per second are
quite costly too, I take it?



Posted at Nginx Forum:,251964,251993#msg-251993

More information about the nginx mailing list