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

I've heard setting keepalive timeout at too high a number will diminish its value. So, to be on the safe side, and still somewhat benefit from it, can I set it to 1 second ?

Or will setting it to 1 second be equivalent to just leaving it OFF ?

share|improve this question
up vote 1 down vote accepted

First of all, before you make any kind of changes, get familiar with the system internals. Install munin to monitor what your system does, how many connections, open sockets, apache processes etc. you have and make choices based on the real numbers/statistics.

KeepAlive's main purpose is to send several static files via HTTP 1.1 on the same connection. So if you disable or set KeepAlive too short the client has to make a connection for every css, js, jpg, whatever static file it wants from your server. Building up a connection takes time, so it is wise to set it to 300 seconds. Most browsers keep connections open from 120 to 300 seconds, also most of the SSL keys have the same 300 sec timeout.

If you experience excess resource usage, then lower it till you reach the value suits your and your clients needs.

share|improve this answer

Where'd you hear that? The risk to having a high KeepAliveTimeout isn't to diminish its value; the risk is that you'll end up with a potential resource exhaustion condition on your web server from too many open keep-alive connections.

At a bare minimum, set the keep-alive timeout to the time it takes a client browser to fully load a typical page; disabling it or setting it too low will force extra reconnects, slowing your page load speeds (and on SSL pages, force extra CPU-intensive negotiations for each reconnect).

share|improve this answer

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.