Optimizing Apache for Low Memory Usage
Hosting providers like Serverpronto offer amazingly good deals on dedicated servers but the tradeoff is that at $30/month, you only get 256MB of RAM with your server.
With so little memory, the default Apache memory configuration in the Redhat distribution will enter a flaming death spiral of swapping under moderate load. If you’re in that boat, you should read Optimizing MySQL and Apache for Low Memory Usage by Emergent Properties.
There are a number of tips, but the most valuable one in my experience was the simplest. Reduce the default keep-alive timeout from 15 seconds to 2 seconds. 2 seconds is long enough to ensure that a page and all of its resources are fetched in a single TCP connection, but greatly reduces the need to create new Apache workers or queue requests because existing workers are tied up waiting for the keepalive timeout.
1 Comment so far
Leave a comment
Hey there, thanks for the link. I run several blogs, a mediawiki install, and a photo resizing website all on a server with 96 megs of ram.
I’m starting to think about upgrading, just because resizing really big photos with GD is taking up some serious ram.
However, as for apache, i’m starting to think that it’s best to just ditch it and go with lighttpd or something similar.
By Matt from Urban Pug on 10.05.06 10:53 pm
Leave a comment