Friday, August 26, 2011

Optimizing Virtualmin to consume lower RAM

July 5, 2010 by  
Filed under Webmin

2 Comments

By default Virtualmin is installed and configured to maximize performance, rather than minimize memory usage. Thus, it may create certain problems on a system with less than 256MB of RAM. However, you can take steps to reduce memory usages! These steps will not hurt performance on a low memory system, as running out of memory is a far greater performance problem than having to load a few libraries on each pageview in Virtualmin.

Note also that Virtualmin, even at 100MB, is not the largest process on a full-featured webserver. Apache will be about 150-250MB once all of the modules are loaded, depending on which modules you use and whether everything runs under mod_fcgid or you use the individual mod_php, mod_perl, mod_ruby, etc. BIND can also grow to 100MB or much more, depending on the number of zones you’re hosting and whether it is providing recursive DNS service. Postfix always stays pretty small, but the spam and anti-virus tools are unavoidably quite memory and CPU intensive.


Steps to disable preloading of Webmin libraries


1. Login to Virtualmin as root.
2. Open the System Settings category on the left menu, then click on Module Config.
3. Change Preload Virtualmin libraries at startup? to No
4. Click Save. You will then be prompted to re-check the Virtualmin configuration.
5. Click the Re-Check button. Once this process is complete, the Webmin server process will reduce RAM use to about 10M.

Alternately, you can do the same thing from the command line by editing /etc/webmin/miniserv.conf

Find this line:

preload=virtual-server=virtual-server/virtual-server-lib-funcs.pl virtual-server=virtual-server/feature-dir.pl virtual-server=virtual-server/feature-unix.pl…

This line is much longer than this on most systems. Insert a # mark at the beginning of the line (before “preload”), to comment it out, and then restart Webmin with the following command:

# /etc/webmin/restart

Then edit /etc/webmin/virtual-server/config, and change the preload_mode line to :

preload_mode=0

This will reduce Virtualmin memory usage from ~90MB to ~10MB. This option determines which Webmin libraries are preloaded on Webmin startup. It makes it faster, if there’s plenty of memory, but on low memory systems avoiding swapping is far more important to performance of all components.

GD Star Rating
a WordPress rating system
Optimizing Virtualmin to consume lower RAM, 10.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 DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Related posts:

  1. Introduction to Virtualmin
  2. Configuring your Firewall for Webmin
  3. How do I find out Linux Resource utilization to detect system bottlenecks?
  4. Running Webmin on demand, and on different port!
  5. How to install Webmin on CentOS, RHEL, Fedora, Mandriva, SuSE

Comments

2 Responses to “Optimizing Virtualmin to consume lower RAM”
  1. ultrasound technician says:

    I’ve recently started a blog, the information you provide on this site has helped me tremendously. Thank you for all of your time & work.

    GD Star Rating
    a WordPress rating system
    Reply
  2. Joseph says:

    Using Virtualmin with anything under 512MB of RAM will get you into a lot of complication.

    Not “Preloading” Virtualmin Libraries will actually reduce your RAM needed at idle by at least 100mb or more rather than the mentioned 10mb.

    In Short, run Virtualmin only when you have enough resources to run it properly. Or else, it’s better to use an optimized for VPS or Low Resouce system control panel such as cPanel VPS Optimized or kloxo. While they aren’t the same in regards to performance and configurability, they will definitely allow you to get by much better on a lower resourced system.

    GD Star Rating
    a WordPress rating system
    Reply

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.