Keep-Alive: Performance Tuning Apache

It is a good idea on most light to medium traffic sites to have keep-alive active on the server. This will allow a single client request to use the same connection thread on all file requests for the page. The disadvantage is that on high traffic sites this can keep many concurrent connections open using alot of server resources and potentially blocking users from accessing your site. In this article linked below it discusses the benefits and drawbacks of keep-alive.

One solution the author proposes is to set the KeepAliveTimeout to 2 seconds which allows enough time for all the files to be requested from the client. This should provide benefits of single connection per page request and not blocking requests for high concurrent sites.

You can view the well detailed article with additional performance tips in the comments here.

Leave a comment

1 Comments.

  1. High traffic sites should have a proxy layer with caching. Based on extensive research and experience we recommend setting up high amount of low line/high spec servers like Dell R210 (1x Xeon E1270 3.4GHz, 8-16 GB of RAM, 4x 146 GB SAS drives).

    The solution described above allows high amount of connections to be divided by number of proxy servers to mitigate resources required for socket/connection management aspects. It’s also worth mentioning that its more resistant to various DOS/DDOS attacks.

    From our experience (we have been working with companies that have 35000 new connections per second to their infrastructure) its better to have more connections established by setting up 2-3 seconds keepalives as oppose to allow for higher amount of connections per second…

    Kind Regards,
    Paul Preston