Memory use flares up sharply, how to troubleshoot?

Maxim Dounin mdounin at mdounin.ru
Tue Jul 22 19:36:24 UTC 2014


Hello!

On Tue, Jul 22, 2014 at 01:07:58PM -0400, gthb wrote:

> > - 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?

Syscalls on Python side, small packets over the network (even 
local one), and syscalls on nginx side are all costly when 
compared to using a reasonably sized buffer on Python side.

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list