Eating RAM

I am comparing two servers use of memory.
I am moving from the “old” to the new “one”
The old one hosts a frequently accessed VS.
Some days ago I realized that the new one, without web servers was taking much RAM than the old one with 12000 daily visits, http and mysql requests (from Virtualmin Sys Info) Let’s say 900 vs 600Mb.

Here’s a report from both servers .
Look at 238 processes - 480 MB on the old server and 140 processes - 1.10Gb
More than double!!
How can this be explained/corrected/opimized ?

Thank you

OLD SERVER
CentOS Linux 5.3
Webmin version 1.520 Virtualmin version 3.80.gpl GPL
Theme version 7.8 Time on server 20/Dec/2010 20:21
Kernel and CPU Linux 2.6.18-164.el5 on i686 CPU load averages 1.09 (1 min) 1.73 (5 mins) 2.08 (15 mins)
Running processes 238 Real memory 1.97 GB total, 480.88 MB used
COMMAND %MEM RSS
httpd 4.3 87.92
httpd 2.2 46.10
httpd 2.1 43.69
httpd 2.0 41.98
httpd 2.0 41.72
httpd 2.0 41.33
httpd 2.0 40.41
httpd 1.9 39.96
httpd 1.9 39.39
httpd 1.9 38.80
httpd 1.9 38.39
httpd 1.8 37.75
httpd 1.8 36.95
httpd 1.8 36.67
httpd 1.7 35.88
httpd 1.7 35.66
mysqld 1.7 35.34
httpd 1.7 34.64
httpd 1.7 34.41

NEW SERVER
CentOS Linux 5.5
Webmin version 1.520 Virtualmin version 3.82.gpl GPL
Theme version 7.8 Time on server 20/Dec/2010 19:01
Kernel and CPU Linux 2.6.18-194.26.1.el5xen on x86_64 CPU load averages 0.07 (1 min) 0.15 (5 mins) 0.22 (15 mins)
Running processes 140 Real memory 2.32 GB total, 1.10 GB used

COMMAND %MEM RSS
httpd 3.2 77.03
httpd 2.6 63.26
httpd 2.6 61.94
httpd 2.5 61.23
httpd 2.5 60.98
httpd 2.5 59.71
httpd 2.2 52.27
httpd 2.1 51.25
httpd 1.9 46.46
httpd 1.9 46.22
httpd 1.9 46.20
httpd 1.9 45.46
php-cgi 1.8 44.85
spamd 1.8 44.53
spamd 1.8 42.83
spamd 1.8 42.74
mysqld 1.7 42.54
httpd 1.6 39.45
httpd 1.5 37.90
php-cgi 1.5 35.6041

what is eating your ram may very well be the spamd processes

Howdy,

Your new server looks like it’s 64bit – processes on 64bit servers do use more RAM than 32bit servers.

On two Debian servers that I’m comparing here, it in many cases can be double the RAM usage.

There could certainly be other differences between those two systems – having different modules loaded into Apache could add to the difference in RAM usage. However, I suspect you’re largely seeing a difference in the 32bit vs 64bit Linux architecture.

-Eric

Eric,

thanks for that info. Installed software is almost the same.
Newer technology always have been taken more ram than the previous.
CPU use is better as expected.
At this time main domain is propagating its new IP. It seems all is going fine.
Thanks

You can also use atop to monitor RAM usage in realtime to find out which processes eat the most. Sure there are points where you can tune memory usage by different parts of your installation, most notable spamd and httpd.

But as long as your RAM usage is at only 50%, and the server is not meant to do much else, I wouldn’t worry. Be rather glad that the RAM is used nicely and the server running efficiently. :slight_smile:

IP propagation is almost done. Use of Ram is almost the same, less running processes compared to previous severs. Higher CPU compared to same server previous report. This is not peak time.
CentOS Linux 5.5
Webmin version 1.520 Virtualmin version 3.82.gpl GPL
Theme version 7.8 Time on server 21/Dec/2010 09:36
Kernel and CPU Linux 2.6.18-194.26.1.el5xen on x86_64 CPU load averages 1.37 (1 min) 2.27 (5 mins) 2.35 (15 mins)
Running processes 161 Real memory 2.32 GB total, 1.19 GB used

COMMAND %MEM RSS
httpd 3.0 71.81
httpd 2.9 71.13
httpd 2.9 71.05
httpd 2.9 70.15
httpd 2.9 70.11
httpd 2.8 68.54
httpd 2.8 68.24
httpd 2.8 67.96
httpd 2.8 67.86
httpd 2.8 67.80
httpd 2.6 61.90
httpd 2.5 61.30
httpd 2.4 58.64
httpd 2.4 58.06
php-cgi 2.3 56.33
httpd 2.1 50.19
httpd 2.0 49.21
php-cgi 2.0 48.30
httpd 1.9 46.46
mysqld 1.9 45.85
spamd 1.8 44.53
php-cgi 1.8 43.73
spamd 1.8 42.83
spamd 1.8 42.74
php-cgi 1.7 42.18
httpd 1.4 34.60
php-cgi 0.7 17.97
php-cgi 0.7 16.71
php-cgi 0.6 16.07
miniserv.pl 0.5 13.45

Thank you Locutus for your suggestion

I have two completely identical Debian servers here – except that one is 32 bit, and the other is 64 bit.

It was actually a bit of an accident that the 32 bit Debian was used, but it serves as a good tool for comparing the two :slight_smile:

I restarted the daemons immediately before looking at their ps output, so the following numbers should be from the moment these processes launch:

32bit Debian

Command VSC spamd 32516 clamav 114632 apache2 184808 miniserv 30156

64bit Debian

Command VSC spamd 108544 clamd 181452 apache2 374912 miniserv 97272

Again – the only difference between these two servers is just the distribution’s architecture. With just those differences – those 4 processes running on a 64 bit system use about 760MB of RAM. The same 4 processes on a 32 bit system require only 360MB of RAM.

That’s a pretty significant difference :slight_smile: But the idea is that if you’re running a 64 bit system, that you’d have enough RAM on hand that the increased performance makes it worthwhile.

-Eric

Is collectinfo.pl running from root’s crontab on your system? Typically, that’s setup by default to run every few minutes. I believe it’s collectinfo.pl that would update those RAM statistics.

One thing you might try is to manually run this, as root from the command line:

/etc/webmin/virtual-server/collectinfo.pl

When you do, do you get any errors? Normally, it just silently exits when it finishes.

After running it, are the RAM values you saw updated? The CPU load average and number of running processes should change too.

-Eric

Hello,

After 3 days of completed move I see that Ram has not been modified. Values are around the same values despite running processes have been growing to double.

CentOS Linux 5.5
Webmin version 1.520 Virtualmin version 3.82.gpl GPL
Theme version 7.8 Time on server 24/Dec/2010 12:02
Kernel and CPU Linux 2.6.18-194.26.1.el5xen on x86_64 CPU load averages 1.07 (1 min) 1.67 (5 mins) 1.76 (15 mins)
Running processes 278 Real memory 2.32 GB total, 1.08 GB used
Virtual memory 4 GB total, 175.80 MB used
Local disk space 449.23 GB total, 206.64 GB used

Merry Christmas!

Hi Eric, Ram values read from VM System Info varies slightly 1.08, 1.11, 1.14 from each refresh page.
I’m just surprised about that.
Collectinfo performed silently w/o errors. Now Ram is 1.34
I don’t see anything suspicious.
Last post was intended only to share info.
Thanks,
Daniel