Friday, August 26, 2011

Optimize Apache using Webmin to consume lower memory

July 6, 2010 by  
Filed under Webmin

Leave a Comment

You can optimize your Apache to use lower RAM in systems where there are shortage of memory or the memory usages are near limit! Here, we are showing how to reduce apache memory usages using Webmin control panel!

How to?

  • Browse to the Webmin Apache Webserver module
  • Click on “Processes and Limits
  • Change the following to the values shown:

Maximum spare server processes 3

Minimum spare server processes 2

Initial server processes 3

Optionally, remove any modules you aren’t using. This actually will reduce memory usage more than anything else–but it’s hard to guess what modules you’ll want/need to do your job.

mod_perl is needed for the new Analytics module in Virtualmin, but otherwise everything can be run under cgi or fcgid…and if memory is a real problem, you may have to give up on Analytics (or set it up manually without our mod_perl filter).

Disabling mod_php4 or mod_php5 is cool (but if you’ve been using it for PHP scripts, you’ll need to make the switch to fcgid first, and reset permissions and ownership up your PHP scripts in domain homes) and will shave quite a bit off the process size.

Other possibilities for disabling: auth_dbm, disk_cache, proxy (but this removes quite a bit of functionality), include (removes Server Side Include functionality), status.

Because Apache is probably the biggest process on any hosting system…if you’re dealing with a VERY small memory system (under 256M), then you’ll have to cut it down a lot. This isn’t really optional in that case.

You can also edit the apache configuration file manually! Here is a sample apache configuration file that is good for systems with low memory:

KeepAlive On
KeepAliveTimeout 3

<IfModule prefork.c>
StartServers   3
MinSpareServers 2
MaxSpareServers 3
ServerLimit  100
MaxClients   100
MaxRequestsPerChild  500

<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 15
MaxSpareThreads 50
ThreadsPerChild 15
MaxRequestsPerChild  0

GD Star Rating
a WordPress rating system
Optimize Apache using Webmin to consume lower memory , 8.0 out of 10 based on 1 rating
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Related posts:

  1. Optimizing Virtualmin to consume lower RAM
  2. Apache configuration (httpd.conf) checking
  3. Updating Apache using Cpanel EasyApache
  4. Configuring your Firewall for Webmin
  5. Secure and Optimize your Virtual Private Server (VPS)

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!
Click here to cancel reply.