questions about proxy buffers

Xavier Noria fxn at hashref.com
Sun Jun 12 22:28:24 MSD 2011


On Sat, Jun 11, 2011 at 4:08 AM, Maxim Dounin <mdounin at mdounin.ru> 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).

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?



More information about the nginx mailing list