5

I've read several blogs about turning KeepAlive off in apache. When I had it turned on, and a spike in traffic, people started timing out, or had to wait +10 seconds for a page load. However, when I turned it off, requests finished almost immediately.

I know HOW KeepAlive functions, and what it does, I just want to know why I would ever need it. If i'm using CSS sprites and combining all my javascript into 1 file, with only 2-3 http requests to the server, is it safe to have it turned off?

1 Answer 1

3

If you can provide your resources very quickly, then a very short KeepAlive timeout should be the way to go, or use no KeepAlive at all.

KeepAlive is important when you are going to have many requests from the same client, but it gets to be a problem if you need to serve to many clients at the same time. KeepAlive with SSL is even more important as the cost to setup a new SSL connection is very high, especially if it is only for a small amount of data.

If you can serve up what you need in only 2-3 request, I'd suggest keeping it short enough to get those requests handled. If that is still not working and other users are hanging for a long time, then you probably need to consider some load balancing and a proxy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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