httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <>
Subject Re: keepalivetimeout and 2.2 configs
Date Mon, 11 Apr 2005 01:57:58 GMT

On Sun, 10 Apr 2005, Rich Bowen wrote:

> While the 2.2 config files are somewhat in flux, I thought I'd bring up
> the topic of KeepAliveTimeout. The default config files have this set to
> 15 seconds. As far as I remember, it is set that way due to some
> possibly-scientific survey that said that "average" web users click ever
> 15 seconds. Even assuming that that was true at some point, it seems to
> me that the main reason for keepalive is for the files (images, css)
> associated with a single page, not for retaining a connection between
> pages. In that case, I would think that 2, or perhaps 3 seconds, would
> be more than sufficient.
> On the more practical non-gut-feeling side, I've found consistently that
> changing KeepAliveTimeout from 15 to 3 immediately, and drastically,
> reduces server load on busy servers, where a significant percentage of
> the child processes are in Keepalive mode most of the time.
> See for an example. Note that
> (most of the time) most of the processes are in K. I'm willing to bet
> that reducing KeepAliveTimeout to 2 or 3 will drop the number of child
> processes significantly, reduce overall server load, and improve server
> performance under peak traffic.

I tend to agree that 15 is too high for prefork, but a couple notes:

- It's always a trade-off between the memory used by the idle worker and 
the performance cost of setting up and tearing down connections. 
Different sites care about those resources to different degrees.

- This is highly mpm-dependent.  For threaded mpms, the cost of an idle 
worker is lower.  For the new event mpm, the problem goes away entirely, 
and you are better off with a much *higher* timeout.  So pushing event up 
the list of recommended mpms would be the best way to solve this.  It 
would be nice if other mpms were a little more flexible about KeepAlive 
policy, like by lowering the timeout when you get near MaxClients.

- If you make KeepAlive less available, you encourage client authors to 
setup more connections to the server, which will cost way more.

- This should be solved in the code-default, not the config-file default. 
The directive will not exist in the default config file in

- 2-3 seconds seems too short for modem or high-latency connections.  5-10 
seems more in the ballpark.


View raw message