Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

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.