Welcome! Log In Create A New Profile

Advanced

Re: Buffer Reuse in Nginx

Alexandr Gomoliako
March 06, 2012 11:30AM
On 3/6/12, Soares Chen <soares.chen@gmail.com> wrote:
> I am trying to write an Nginx module that receive input and produce
> output in streaming fashion over long lasting connection. Due to the
> nature of the connection, I can't wait for all the buffers to be
> reclaimed at the end of the request, as that would potentially cause
> high memory consumption to the server. As a result, I am looking for
> ways to determine if buffers sent through ngx_http_output_filter() are
> safe to be reused.

There is another way: you can skip ngx_http_output_filter() altogether
and use r->connection directly with c->send/c->recv and your own
handlers for c->read/c->write.

This will be much easier with perl though. I didn't document it very
well, but I'm willing to help you, if you are going to use this:
http://zzzcpan.github.com/nginx-perl/Nginx.html#CONNECTION_TAKEOVER

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

Buffer Reuse in Nginx

Soares Chen 1909 March 06, 2012 11:06AM

Re: Buffer Reuse in Nginx

Alexandr Gomoliako 589 March 06, 2012 11:30AM

Re: Buffer Reuse in Nginx

Maxim Dounin 674 March 06, 2012 12:28PM

Re: Buffer Reuse in Nginx

Soares Chen 696 March 07, 2012 08:44AM

Re: Buffer Reuse in Nginx

Maxim Dounin 772 March 07, 2012 09:46AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 149
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