Is this normal memory usage?

3 posts / 0 new
Last post
#1 Mon, 06/06/2011 - 15:19
st00dent

Is this normal memory usage?

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.

Mon, 06/06/2011 - 15:27
andreychek

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

Tue, 06/07/2011 - 07:06
Locutus

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:

  PID MINFLT MAJFLT      VSTEXT  VSIZE  RSIZE  VGROW  RGROW  MEM CMD     1/4
 7687      0      0        434K 255.1M 29764K     0K     0K   1% apache2
16549      0      0        434K 256.6M 13596K     0K     0K   1% apache2
16345      0      0        434K 256.5M 13556K     0K     0K   1% apache2
16597      0      0        434K 256.4M 13540K     0K     0K   1% apache2
16598      0      0        434K 256.5M 13444K     0K     0K   1% apache2
16679      0      0        434K 256.4M 13228K     0K     0K   1% apache2
16795      0      0        434K 256.4M 13032K     0K     0K   1% apache2
16797      0      0        434K 255.9M 12180K     0K     0K   1% apache2
16796      0      0        434K 255.9M 12168K     0K     0K   1% apache2
 2668      0      0        434K 210.7M 10444K     0K     0K   1% apache2

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.

Topic locked