[ANNOUNCE] ngx_http_upstream_keepalive

Maxim Dounin mdounin at mdounin.ru
Fri Oct 24 20:56:28 MSD 2008


Hello!

On Fri, Oct 24, 2008 at 06:34:00PM +0200, Grzegorz Nosek wrote:

> On Fri, Oct 24, 2008 at 08:21:29PM +0400, Maxim Dounin wrote:
> > On Fri, Oct 24, 2008 at 05:57:40PM +0200, Grzegorz Nosek wrote:
> > > On Fri, Oct 24, 2008 at 07:42:12PM +0400, Maxim Dounin wrote:
> > >> In short: it's keepalive upstream balancer module, it may be used
> > >> to keep connections to memcached alive.
> > >
> > >Cool! :)
> > 
> > Feel free to report bugs / success stories. :)
> 
> I don't actually use Memcached with Nginx but I _am_ interested in
> keepalive HTTP/FastCGI connections. It's a great start.
> 
> > > Is there any fundamental problem with supporting e.g. HTTP? Apart from
> > > not breaking the HTTP spec and sending Connection: keepalive (or
> > > whatever it looks like for HTTP/1.0)?
> > 
> > Not really fundamental.  But this will at least require nginx patching.
> 
> Couldn't the header get injected in a filter? Or are other changes
> required?

Request to upstream is created in ngx_http_proxy_module, so no 
filters there.

You may try to use proxy_set_header though, and then use 
proxy_hide_header to filter out Keep-Alive header from the 
response.  It may even work - if backend handle HTTP/1.0 keepalive 
connections and won't try to sent chunked encoding to nginx.

But in fact nginx should be modified to support HTTP/1.1 to 
backends.

For FastCGI it should be as simple as not setting appropriate close 
bit in request created by ngx_http_fastcgi_module (and using my 
patches for connection closing), but I've not checked it yet.

Maxim Dounin





More information about the nginx mailing list