Keepalive not working with upstream tcp server

Jayadev C jayadev at
Wed Apr 2 16:43:49 UTC 2014

I am setting u->keepalive = 1 in my module too, but let me double check that though.

Meanwhile , is the keepalive done by http_upstream_keepalive_module ? Is it included by default or do I need to compile explicitly include that module.  I don't see the code going through that module in my request flow.


On Wednesday, April 2, 2014 7:53 AM, Maxim Dounin <mdounin at> wrote:

On Wed, Apr 02, 2014 at 01:01:07AM -0700, Jayadev C wrote:

> I am trying to use nginx to proxy my requests to a custom tcp 
> backend server that I have. I am following the same model as the 
> default memcached module with in the nginx code base (1.5.10) , 
> the relevant
 config file attached.  Tried with most of the 
> keepalive options but I still see new connections getting 
> created to upstream server. (rather I do see the connection 
> getting closed by nginx in strace)


>                  my_pass my_backend;

Looks like you did something wrong in you module.  Note that 
memcached module explicitly sets u->keepalive when it's ok to keep 
a connection alive.

Maxim Dounin

nginx mailing list
nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list