How do proxy_module response buffering options work?

Hongli Lai lists at ruby-forum.com
Mon Apr 25 12:27:05 MSD 2011


Maxim Dounin wrote in post #994792:
> No, nginx passes downstream chain of buffers, not a single buffer.

I understand this, but I don't understand how there can be more than 1 
buffer at a time that's only partially passed downstream. I had in mind 
that it works like this:

Suppose that Nginx is configured with 4 buffers, each 100 bytes in size. 
The upstream response is 400 bytes.
Bytes 0-99 from the response are put in buffer 1, bytes 100-199 are put 
in buffer 2, bytes 200-299 are put in buffer 3, bytes 300-399 are put in 
buffer 4.
Nginx flushes buffer 1 downstream, thus buffer 1 is now a "busy buffer" 
while all the other ones are not. Only when buffer 1 is entirely flushed 
will Nginx continue to flush buffer number 2 (buffer 1 is now marked 
"ready" of some sort so that it may be reused.)

How can there be multiple busy buffers? Is my description correct?

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



More information about the nginx mailing list