keepalive and workers

Manlio Perillo manlio_perillo at
Mon Jul 7 16:35:34 MSD 2008

Michał Jaszczyk ha scritto:
> Hi,
> I'm creating a website with Nginx and have some questions. When a user
> comes with a request, my application server has to connect to many
> other servers in order to create the response. Due to separation of
> concerns pattern, application server and all other servers are
> separate HTTP servers, each built with Nginx. 

So you have the main frontend server, with mod_proxy to N backend 
servers, and then each backend connects to M other servers?

> Okay, so this is the
> situation I'm in (hopefully my description was clear :) ), and now
> come the questions:
> - Will I have any performance gain if I keep connections from app
> server to other servers instead of opening/closing them with every
> request from a user?

I'm not sure to understand how do you handle the connections, but the 
Nginx mod_proxy does not support persistent connections.

> - Can I set keepalive in Nginx to last forever?
> - If a connection is kept alive, is it handled by the same Nginx
> worker when new requests come in?
> Regards,
> Mike

Manlio Perillo

More information about the nginx mailing list