Welcome, Guest
Please Login or Register.
Lost Password?
Does Virtual Min show the real "Real memory"? (1 viewing)
Post Reply

TOPIC: Does Virtual Min show the real "Real memory"?

#4285
Dirk (User)
Posts: 38
graphgraph
Does Virtual Min show the real "Real memory"? 2007/03/25 11:02  
Hi,
the virtualmin system info shows 1.97 GB real memory for my system. I only have 128MB granted by my provider.

I looked at /proc/user_beancounters and this is the relevant entry:
resource held maxheld barrier limit failcnt
privvmpages 98476 98643 138256 202568 463

So shouldn't virtualmin show me the real memory of around 128MB?

How much memory should a virtualserver with "standard" config with Virtualmin on Debian provide to run stable?

regards Dirk
  The administrator has disabled public write access.
#4286
Joe (Admin)
Posts: 4213
graph
Re: Does Virtual Min show the real "Real memory"? 2007/03/25 12:54  
Hey Dirk,

For full-service hosting (web, mail, DNS, database) for even a few users you're going to need at least 256MB, and I'd recommend 512MB.

Virtualmin, in its default configuration, swallows about 90MB of RAM...but this can be reduced to about 10MB just by turning of the pre-loading features (but this makes it slower on bigger systems--running out of memory makes everything slower, so on low-memory systems, it's better to reduce the memory usage of all services when possible).

Note 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. Postfix always stays pretty small, but the spam and anti-virus tools are huge.

I've seen "small memory" stuff come up quite a bit here, so I'm going to run down a list of things to do to make your experience better.

So, here goes:

Reduce Virtualmin memory usage:

Edit /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. Delete it. This will reduce Virtualmin's 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.

Reduce Apache memory usage:

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 by 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). So, 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.

Reduce mail processing memory usage

The actual mail services are tiny. The spam and anti-virus filtering services are not. You may want to consider simply forwarding mail on to a free Gmail account or something that has good spam/AV filtering. This is limiting...but it means your mail service can be provided in a few MB. In such a case, you'd turn off dovecot, and would never have to spawn SpamAssassin or clamav. If you do have to deliver mail locally, don't use clamd or spamc, as those have processes that always run...unless you get enough mail to keep them respawning every minute or more (because the memory is effectively made unavailable anyway--might as well get the mail processed faster and give away a little memory).

Reduce unnecessary services

Shut down postgresql or mysql or both. If you're not using databases, don't run them.

Shut down proftpd, if you can convince yourself and/or your users to use the Webmin modules or ssh/scp for file transfers.

Don't even think about running X. (You probably don't want to run X on any server...but if you've got plenty of RAM, I won't argue the point. But if you're short of memory, shut it down!)


There's probably a few other ways to reduce memory usage...but that's what comes to mind right now. 128MB is pretty tight for hosting, even with all of these steps.
  The administrator has disabled public write access.
#4289
Dirk (User)
Posts: 38
graphgraph
Re: Re: Does Virtual Min show the real "Real memory"? 2007/03/25 18:13  
Wow, very good detailed description - will do it tomorrow and post results. I suggest this needs to go into the FAQ.

Its a pitty, that (almost) every large Hostprovider tries to give the impression, their vservers are the biggest and strongest for that little price. So they should tell, that with 128MB guaranteed RAM there is no much value in a vserver. Why should I rent a vserver if all I want to do is to deliver static webpages... My and most likely other users idea for a vserver is to start with PHP and databases.

bye for today Dirk
  The administrator has disabled public write access.
#4290
Dirk (User)
Posts: 38
graphgraph
Re: Re: Does Virtual Min show the real "Real memory"? 2007/03/25 18:23  
Besides the very good howto...

VirtualMin doesn't show the real server available on my vserver as stated in my initial post. Is this a bug?

Dirk
  The administrator has disabled public write access.
#4292
Joe (Admin)
Posts: 4213
graph
Re: Re: Re: Does Virtual Min show the real "Real memory"? 2007/03/25 21:30  
Hey Dirk,

VirtualMin doesn't show the real server available on my vserver as stated in my initial post. Is this a bug?

Yes. But it's a bug (OK, misfeature) in Virtuozzo, not Virtualmin. The kernel is lying to us about system memory. Or, actually, it's telling the truth, but it's a truth that you can't take advantage of because the system is preventing access to the rest of that 2GB. ;-)

Basically, Virtualmin asks the kernel how much memory it has, and the kernel replies. Virtualmin prints it out. I believe Virtuozzo is the one behaving badly here, but we can accommodate it.

"user_beancounters" is not where on usually looks for memory usage...but it appears to be on a Virtuozzo (and probably vserver and openvz, since they are all nearly identical under the covers), but we've just never added support for that file.

I'll file a wish in the bug tracker, so maybe by 3.39 (3.38 is already in QC testing as we speak, with a planned rollout tonight) this source of memory data will be supported.
  The administrator has disabled public write access.
#4293
JamieCameron (Admin)
Posts: 374
graphgraph
Re: Does Virtual Min show the real "Real memory"? 2007/03/25 23:20  
The next Webmin release will fix this, by using the limit in /proc/user_beancounters when it is exists. Currently it reads /proc/meminfo, which shows the RAM available on the 'real' system .. which is not relevant when running under a VM.

By the way, I second Joe's comment about 128M of RAM not being enough. Virtualmin can run on 256M, but 512 or more is better..
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.