The Apache KeepAlive directive specifies that TCP/IP connections from clients to the Apache server are to be kept 'alive' for a given duration specified by the value of KeepAliveTimeout (the default is 15 seconds). This is useful when you serve out heavy HTML with embedded images or other resources, since browsers will open just one TCP/IP connection to the Apache server and all the resources from that page will be retrieved via that connection.
If, however, your Apache server handles small individual resources (such as images), then KeepAlive is overkill, since it will make every TCP connection linger for N seconds. Given a lot of clients, this can quickly saturate your Apache server in terms of network connections.
So...if you have a decent server that doesn't seem to be overloaded in terms of CPU/memory, yet Apache is slow-to-unresponsive, check out the KeepAlive directive and try setting it to Off. Note that the default value is On.
More Apache performance tuning tips are in the official Apache documentation.
Subscribe to:
Post Comments (Atom)
Modifying EC2 security groups via AWS Lambda functions
One task that comes up again and again is adding, removing or updating source CIDR blocks in various security groups in an EC2 infrastructur...
-
A short but sweet PM Boulevard interview with Jerry Weinberg on Agile management/methods. Of course, he says we need to drop the A and actu...
-
Here's a good interview question for a tester: how do you define performance/load/stress testing? Many times people use these terms inte...
-
Update 02/26/07 -------- The link to the old httperf page wasn't working anymore. I updated it and pointed it to the new page at HP. Her...
3 comments:
I've been trying to find something difinitive on this topic. We have an image server it serves only, *.jpg, *.png, *.gif, *.css and *.js files.
We have keep alive set to 5 seconds. Would setting keep alive to off be faster?
Hayden -- yes, try setting KeepAlive Off and see how it goes. Another thing that's obviously recommended is to use a CDN service to offload static files off of your servers.
Keepalive has a different affect on memory and CPU. Turning keepalive off actually increases CPU usage. I wrote a blog post with a detailed analysis of Apache keepalive.
Post a Comment