Output body buffer chain "flattening" doesn't work unless proxy buffering is off

Maxim Dounin mdounin at mdounin.ru
Mon Jun 7 00:57:04 MSD 2010


On Fri, Jun 04, 2010 at 11:56:25PM +0200, Srebrenko Šehić wrote:

> While working on an output body filter, I've noticed that if I flatten
> (join all buffers from a chain into 1 buffer), response processing
> hangs when nginx decides to start buffering the response from the
> upstream server. This usually happens (in my case) when the upstream
> response size is >64k.

You don't marked buffers as send, and proxy has no more free 
buffers to use (proxy_buffers defaults to 8 x 8k == 64k on 
amd64; looks like you didn't tested your code on 32-bit 
platforms... :)).

> If I set "proxy_buffering" to "off" in my
> config, everything works just fine.

This is actually strange.  With proxy_buffering off; it should 
stop doing anything usefull as soon as proxy_buffer_size will be 
exceeded.  Well, it will call output filter again and again, with 
the same buffer chain, but it doesn't seem to match words "works 
just fine".


Maxim Dounin

More information about the nginx-devel mailing list