questions about proxy buffers

Maxim Dounin mdounin at
Tue Jun 14 01:56:47 MSD 2011


On Sun, Jun 12, 2011 at 08:28:24PM +0200, Xavier Noria wrote:

> On Sat, Jun 11, 2011 at 4:08 AM, Maxim Dounin <mdounin at> wrote:
> Hi Maxim, that was an awesome reply, thank you very much.
> >> Let's say now the proxied server sends a response consisting of 16k.
> >> Does the module fill 4 buffers, as quickly as possible, and when
> >> everything is done it sends the 16k to the client? Or does it start
> >> sending the first buffer while filling the second one?
> >
> > It will start sending as long as it has nothing to read for a
> > while (i.e. read() from upstream will return EAGAIN).
> That's a rule of thumb even if we are filling the first data buffer?
> (to distinguish from the first buffer whose primary content are
> headers).

Buffers which aren't fully filled aren't sent with proxy_buffering 

> I have in mind chunked responses from the proxied server in that
> question. Imagine we are producing a HTML response whose head is kinda
> static content, but whose dynamic body is costly. If the app sends a
> chunk with the head of the document, and after that some amount of
> time passes after the bytes from the second chunk come (because they
> are costly to produce), would in general nginx send that head to the
> client?


Maxim Dounin

More information about the nginx mailing list