questions about proxy buffers

Xavier Noria fxn at hashref.com
Sat Jun 11 03:50:59 MSD 2011


Hello,

I have read the documentation of the HTTP Proxy Module regarding
buffers and would like to understand which is the exact (basic)
workflow regarding buffers only. Let me ask about some scenarios,
assuming everything fits in memory and ignoring caching workflows etc.

Let's suppose proxy_buffer_size is 4k and proxy_buffers is 8 4k.

Say the proxied server sends a response of 2k. Then I guess the entire
response is buffered, as quickly as possible, and when the proxied
server is done, then nginx starts sending the buffer to the client. Is
that right?

The description of proxy_buffer_size says "This directive set the
buffer size, into which will be read the first part of the response,
obtained from the proxied server." What is the *first* part of the
response? Does it mean the chunk that fits in the first buffer? In
this case exactly 4k? If that's correct, what does the module do with
the "subsequent" parts? does proxy_buffer_size have anything to do
with them? Or are those for the remaining 7 buffers, 4k each?

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?

Here "nginx does not attempt to read the entire answer from the
proxied server, the maximum size of data which nginx can accept from
the server is set by directive proxy_buffer_size." should
proxy_buffer_size be proxy_buffers, or rather a combination of the
two?

What happens if the proxied server sends a response greater than the
total buffer sizes, say 50k? Does nginx frees buffers sending data,
and then buffers another chunk from the proxied server, iterate until
done?

What's proxy_busy_buffers_size?

Thanks!!!



More information about the nginx mailing list