I've been working on improving memory usage on our Centos 5.5 VDS, which now has 512MB of RAM. I've been able to use a tuneup script to greatly improve the MySQL config but am having a bit more trouble getting Apache's memory usage down. Part of my problem is conflicting advice on a various web sites, forums, etc. Being a production server the normal modify and test cycle I would employ on a test machine would be a bit too disruptive.
To add to my confusion, I have a dev machine configured as near as I can make it to be a clone of the VDS and it uses less RAM with the exact same Apache configuration. Although it's obviously difficult to apply the same load I get pretty close when comparing the two during the quiet times of the day or night.
Is there a tuneup script for Apache, like those available for MySQL, that can help optimize the configuration by analyzing what's happening while the server is running?
Edit:
Either I've been unclear or people are not reading the question, so I'll clarify.
I'm not asking anyone here to make recommendations or suggest alternatives. I'm asking if someone here knows of a script which can analyze what's happening on the server and make recommendations regarding the Apache configuration based on that information.
Best Answer
I don't know of any such script for Apache likely because, compared to MySQL, there are only a few things which affect Apache's memory usage:
A few specific things you can try are listed below. Try to measure the effect and test on your development platform first if possible and/or implement any changes gradually on the production site.
MaxClients
as low as possible. On a low volume site you can likely get away with numbers well under 10. You can also keep other related settings likeMaxSpareServers
low.MaxRequestsPerChild
if you are using any dynamic scripts or are seeings the Apache instances slowing increasing in memory usage over time. This stops memory hungry or leaking scripts from using up too much memory.