Welcome! Log In Create A New Profile

Advanced

How do proxy_module response buffering options work?

Hongli Lai
April 24, 2011 10:50AM
I'm trying to understand how the different proxy_module response
buffering options work. The current documentation is a little bit vague.
Here's how I currently think buffering works:

Nginx allocates a number of separate buffers for buffering the response.
They are probably used as a ring for efficiency reasons.

The first buffer is used to store the response header, and must be large
enough to store the header. I'm guessing this is because the proxy
module's response header parser can only operate on a contiguous block
of memory. The size of this first buffer can be customized through
proxy_buffer_size, but it has no effect on all the other buffers.

If proxy_buffering is turned on then Nginx will fill all proxy buffers
with data, either until the upstream sends EOF or until the buffers are
full. When one of those conditions occur Nginx will flush the data to
the client. If the client does not read data quickly enough Nginx will
write the unflushed buffer data to disk and will flush them when the
client can read more data. This is repeated until the upstream sends
EOF.

If proxy_buffering is turned off then Nginx will also fill all proxy
buffers. However it tries to immediately flush the data to the client.
If the upstream sends data faster than the client can read then the
proxy buffers will eventually be full and upstream will be throttled
until the client can read more data.

Is this correct? There's also proxy_busy_buffers_size but I have no idea
what that is.

--
Posted via http://www.ruby-forum.com/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

How do proxy_module response buffering options work?

Hongli Lai April 24, 2011 10:50AM

Re: How do proxy_module response buffering options work?

Maxim Dounin April 24, 2011 05:24PM

Re: How do proxy_module response buffering options work?

Hongli Lai April 24, 2011 06:08PM

Re: How do proxy_module response buffering options work?

Maxim Dounin April 24, 2011 06:16PM

Re: How do proxy_module response buffering options work?

Hongli Lai April 25, 2011 08:16AM

Re: How do proxy_module response buffering options work?

Maxim Dounin April 25, 2011 02:54PM

Re: How do proxy_module response buffering options work?

liuzhida November 17, 2011 09:52PM

Re: How do proxy_module response buffering options work?

Maxim Dounin November 18, 2011 09:02AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 262
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready