Hi,
I've installed virtualmin on my VPS and the memory usage seems very high in my opinion. I have 3 PHP sites, 1 Django-based app using nginx to serve static content and it also hosts a single email account.
All of the above sites are VERY low traffic - maybe 50 hits per week at the moment!
Yet my total memory usage is as follows:
Real memory 1.46 GB total, 1.02 GB used
The main culprit seems to be Apache, as shown below.
Owner Size Command
www-data 494536 kB /usr/sbin/apache2 -k start
www-data 294448 kB /usr/sbin/apache2 -k start
www-data 287308 kB /usr/sbin/apache2 -k start
www-data 253704 kB /usr/sbin/apache2 -k start
I want to add a site that will have much more traffic but I am worried the VPS will struggle.
Can anyone tell me if this is normal and if / how I can make if more efficient?
Any advice appreciated.
Thanks.
Howdy,
Well, the full stack of software that Virtualmin installs can be memory intensive. ClamAV, SpamAssassin, and Mailman are particularly notorious for using a noticeable amount of RAM. Amongst others.
You may want to disable things that you don't need. There's instructions on doing that here:
http://www.virtualmin.com/documentation/system/low-memory
However, determining how much RAM is really being used on a system can be a bit, well, elusive... if you run "free -m", note the "Buffers" and "Cached" lines. That memory technically isn't in use. That's just Linux temporarily putting RAM to use that otherwise isn't needed.
For what it sounds like you're doing, you should be fine though on a system with 1.5GB of RAM. I'd make sure you have some swap space if possible though, that'll help handle any traffic bursts you get.
-Eric
What command did you use to produce this output? What memory allocation for Apache is shown there exactly?
If an Apache process really uses half a GB of memory, that's indeed a bit excessive. My current Apache memory figures are like so:
The RSIZE is the relevant one.
Are you using
mod_php5
for PHP sites? If so, its memory will get added to Apache since it's running in the same process. Maybe your PHP applications have some memory leaks.It might help to tweak the settings in
Webmin -> Servers -> Apache Webserver ->Global configuration -> Processes and Limits
Especially "Maximum requests per server process" can help against memory leaks, by restarting Apache processes after a number of requests.