Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Keep-Alive connection feature in HTTP protocol is meant to reduce TCP connection hits to web server. It should be able to improve web server performance. However, I found that some web servers deliberately disable KeepAlive feature from server side.

In my understanding, some reverse proxy, i.e. HAProxy, disables HTTP keep-alive in order to reduce memory usage which is more critical than CPU usage in some situation.

Is there any other reason why Web server disables Keep-Alive?

share|improve this question
up vote 2 down vote accepted

Keep alive is meant to reduce the number of tcp-setups, which are chatty and are heavily influenced by latency. It's main goal is to improve client performance - as for a modern server-os there is a low cost in setting up tcp connections.

Some proxies/loadbalancers lean disable keep-alive to the webservers because they assume the actual servers and are on a LAN with neglible latency, and therefore neglible tcp setup penalty. It also lessens the complexity of the balancing software, as there is not necessarily a one-to-one relationship between incomming and outgoing (from the LB's perspective) connections.

There are few reasons why a server would disable keep-alive, so I suspect it's probably admins at fault. One exception are the a-child-per-connection servers (apache), where releasing that child/thread as soon as possible offers advantages, even if the total browser experience (and bandwidth usage) becomes poorer.

Note that afaik keep-alive is an optional feature and no service is required to implement it.

share|improve this answer
NGINX allows keepalive on the server side. However it allows you to specify the limit of keep alive connections. How do we calculate how many connections is optimal? – CMCDragonkai Apr 15 '14 at 4:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.