Buffers of zero size and filter module

Valentin V. Bartenev ne at vbart.ru
Wed Jul 25 21:29:28 UTC 2012

On Thursday 26 July 2012 00:06:37 Daniel Fiala wrote:
> My questions are:
> * Can such buffers of zero size really appear?

Yes, they can. They often used to indicate the end of stream or to
flush buffers.

> * Is the number of buffers of zero size small? As I understand, memory of
> the chain-link is not recycled until the http request is not fully
> processed.

But it is actively reused. If you look at the ngx_alloc_chain_link()
function you will find that it tries to get a link from pool->chain,
while ngx_free_chain() puts chain links to pool->chain.

 wbr, Valentin V. Bartenev

More information about the nginx-devel mailing list