store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Sat May 18, 2013 5:17 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 8 posts ] 
Author Message
 Post subject: Memory usage grows to almost 4gb with only Virtualmin & ASL
Unread postPosted: Sat Jun 16, 2012 10:15 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Jun 09, 2009 12:57 pm
Posts: 133
I have recently installed ASL 3.0 and Webmin on CentOS 6.2 x64. Even if I stop the SSH server, Apache and ProFTPd, leaving only system services (minimal), MySQL, ASL (with its auxiliary services) and the small webserver used by Webmin (15mb) running RAM usage is about 3.75gb. I have watched RAM usage grow from a little over 1gb to nearly 4gb in the course of a few hours.

How can I find out what is causing this? Here is the relevant output:

Code:
top - 02:20:31 up 1 day,  9:00,  2 users,  load average: 0.38, 0.35, 0.29
Tasks: 201 total,   1 running, 200 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.0%us,  0.9%sy,  0.0%ni, 98.1%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   6640448k total,  6446872k used,   193576k free,   151644k buffers
Swap:  8749048k total,      424k used,  8748624k free,  2195304k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
31384 root      20   0  393m 279m 5508 S  0.0  4.3   0:22.49 clamd
 1523 mysql     20   0 2080m 131m 7024 S  0.3  2.0   1:36.86 mysqld
13316 root      20   0  450m  81m  10m S  0.0  1.3   0:00.20 httpd
28414 tortix    20   0  374m  78m 5812 S  0.0  1.2   0:35.89 tortixd
19757 tortix    20   0  374m  78m 5788 S  0.3  1.2   0:25.65 tortixd
17858 tortix    20   0  372m  78m 4920 S  0.0  1.2   0:26.64 tortixd
31482 tortix    20   0  373m  78m 5784 S  1.0  1.2   0:05.43 tortixd
17976 tortix    20   0  372m  77m 4904 S  1.0  1.2   0:26.84 tortixd
 1641 root      20   0  368m  76m 7316 S  0.0  1.2   0:03.36 tortixd
13330 apache    20   0  451m  74m 2040 S  0.0  1.1   0:00.00 httpd
13331 apache    20   0  450m  72m  816 S  0.0  1.1   0:00.00 httpd
13332 apache    20   0  450m  72m  812 S  0.0  1.1   0:00.00 httpd
13333 apache    20   0  450m  72m  812 S  0.0  1.1   0:00.00 httpd
13334 apache    20   0  450m  72m  812 S  0.0  1.1   0:00.00 httpd
13335 apache    20   0  450m  72m  812 S  0.0  1.1   0:00.00 httpd
13336 apache    20   0  450m  72m  812 S  0.0  1.1   0:00.00 httpd
13337 apache    20   0  450m  72m  812 S  0.0  1.1   0:00.00 httpd
13329 apache    20   0  328m  68m  616 S  0.0  1.1   0:00.00 httpd
18754 root      20   0  155m  54m 1800 S  0.0  0.8   0:04.18 perl
 1819 root      20   0 98.5m  15m 1572 S  0.0  0.2   0:01.24 miniserv.pl
13696 siteaaaa  20   0  237m  12m 7392 S  0.0  0.2   0:00.03 php-cgi
11060 root      20   0  150m 9040 1460 S  0.0  0.1   0:00.25 psmon
13101 postfix   20   0  134m 4116 2808 S  0.0  0.1   0:00.00 cleanup
12861 root      20   0  136m 3760 2840 S  0.0  0.1   0:00.00 sshd
31364 root      20   0  146m 3748 2832 S  0.0  0.1   0:00.02 sshd
13103 postfix   20   0  123m 3480 2600 S  0.0  0.1   0:00.00 smtp
 1623 postfix   20   0  116m 3392 2456 S  0.0  0.1   0:00.11 qmgr
10318 postfix   20   0 94276 3228 2372 S  0.0  0.0   0:00.01 pickup
 1614 root      20   0  136m 3200 2356 S  0.0  0.0   0:00.46 master
31121 ossecm    20   0 83920 3056 1036 S  0.0  0.0   0:00.26 ossec-dbd
31138 ossec     20   0 12952 2556  636 S  0.0  0.0   0:02.21 ossec-analysisd
13028 root      20   0  153m 1952 1496 S  0.0  0.0   0:00.01 bash
13386 nobody    20   0  188m 1948  724 S  0.0  0.0   0:00.00 proftpd
31153 root      20   0 30524 1864  452 S  0.3  0.0   0:01.83 ossec-syscheckd
32578 root      20   0  152m 1852 1480 S  0.0  0.0   0:00.00 bash
12928 vmadmin   20   0  127m 1832 1484 S  0.0  0.0   0:00.00 bash
31367 vmadmin   20   0  153m 1832 1480 S  0.0  0.0   0:00.00 bash
12927 vmadmin   20   0  136m 1704  772 S  0.0  0.0   0:00.00 sshd
31366 vmadmin   20   0  146m 1700  772 S  0.0  0.0   0:00.03 sshd
12957 root      20   0  171m 1656 1256 S  0.0  0.0   0:00.00 su
32483 root      20   0  165m 1656 1256 S  0.0  0.0   0:00.00 su
 1401 root      20   0  162m 1548 1284 S  0.0  0.0   0:00.00 mysqld_safe
    1 root      20   0 68416 1416 1224 S  0.0  0.0   0:01.37 init
13709 root      20   0 56880 1396  956 R  0.3  0.0   0:00.02 top
 1292 root      20   0  265m 1344  904 S  0.0  0.0   0:01.93 rsyslogd


> free -m
             total       used       free     shared    buffers     cached
Mem:          6484       6334        150          0        147       2146
-/+ buffers/cache:       4040       2444
Swap:         8543          0       8543

_________________
CentOS 6.3 (2.6.32.60-40.art.x86_64)
ASL 3.2.13-30.el6.art
Webmin 1.6.2
Virtualmin 3.99.gpl
Apache 2.2.15
PHP 5.3.3 (mod_fcgid/2.3.7)


Last edited by gaia on Sat Jun 16, 2012 10:31 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Sat Jun 16, 2012 10:26 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3242
Location: Chantilly, VA
If you havent read it already, you may want to read this article I wrote that should help to explains how Linux reports memory usage, and why what some tools report isnt accurate (and why all Linux kernels do this, and use less memory that it seems)

https://atomicorp.com/company/blogs/259 ... emory.html

So a quick look:

# free -m
total used free shared buffers cached
Mem: 6484 6225 259 0 150 2170
-/+ buffers/cache: 3905 2579
Swap: 8543 0 8543

Youve got about 2GB as cached reads. As you may know, over time all Linux kernels (and other modern operating systems) will cache reads to make them faster, so over time you absolutely should see more RAM in "use" because cached use absolutely will grow to fill all the available unused memory on the system. This memory is not actually in use, cached reads are treated as free memory by the kernel. If it needs more memory it will use that space.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Sat Jun 16, 2012 10:59 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Jun 09, 2009 12:57 pm
Posts: 133
mikeshinn wrote:
If you havent read it already, you may want to read this article I wrote that should help to explains how Linux reports memory usage, and why what some tools report isnt accurate (and why all Linux kernels do this, and use less memory that it seems)


I was going by the reported usage on ASL (4200mb) and Webmin (3.75gb)

mikeshinn wrote:
Youve got about 2GB as cached reads. As you may know, over time all Linux kernels (and other modern operating systems) will cache reads to make them faster, so over time you absolutely should see more RAM in "use" because cached use absolutely will grow to fill all the available unused memory on the system. This memory is not actually in use, cached reads are treated as free memory by the kernel. If it needs more memory it will use that space.


ok, but why is a VM with 6556MB of available RAM that is running nothing yet swapping already?
And if 2gb is cache, is 1.6gb normal memory usage for running only Webmin and ASL?

_________________
CentOS 6.3 (2.6.32.60-40.art.x86_64)
ASL 3.2.13-30.el6.art
Webmin 1.6.2
Virtualmin 3.99.gpl
Apache 2.2.15
PHP 5.3.3 (mod_fcgid/2.3.7)


Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Sat Jun 16, 2012 11:06 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3242
Location: Chantilly, VA
Based on the data you posted, you dont have any swap in use :

Code:
             total       used       free     shared    buffers     cached
Mem:          6484       6334        150          0        147       2146
-/+ buffers/cache:       4040       2444
Swap:         8543          0       8543


The third column, 0, is the amount of swap in use.

Quote:
And if 2gb is cache, is 1.6gb normal memory usage for running only Webmin and ASL?


Perhaps. It depends on what your server is doing, and what those applications are doing. Applications cache as well, and will use up memory again to speed things up. Memory is cheap, so modern applications take advantage of any free memory they can. for example, mysql will SCREAM if you let it use more memory for caching selects, and other things. Apache will run faster if its allowed to use its caches. PHP has addons that will cache opcodes, again for speed and so on. RAM is orders of magnitude faster than reading from the drives, so if you let your applications cache more things they will be much (much!) faster.

I wouldnt worry so much about memory these days. Its cheap, you have plenty of it, your system isnt using even a fraction of whats available- you still have unallocated memory, nothing is using it, which means your system really isnt using much memory at all. A healthy box will use up all the RAM available, and you wont see swap in use (you might see a tiny amount, some applications can force themselves to swap, so if its a tiny percentage of swap thats normal too).

In short, your system looks normal and healthy and isnt using more than a fraction of the RAM you have now. That will grow, and thats also normal with all Linux kernels. The more modern ones are even more aggressive at making good use of otherwise unused memory. Case in point my Fedora 16 desktop, running the stock Fedora 3.3.7-1 kernel:

Code:
            total       used       free     shared    buffers     cached
Mem:         16042      15743        299          0        155       7317
-/+ buffers/cache:       8271       7771
Swap:        15998       2799      13198


So basically nothing "free", but if you look carefully half of my RAM is just cache. So in reality, my desktop is only using 50% of the memory available (and I run a ton of stuff, virtual machines, multiple users running different desktop processes, etc.).

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Sun Jun 17, 2012 8:44 am 
Offline
Forum Regular
Forum Regular

Joined: Tue Jun 09, 2009 12:57 pm
Posts: 133
mikeshinn wrote:
Based on the data you posted, you dont have any swap in use :

Code:
             total       used       free     shared    buffers     cached
Mem:          6484       6334        150          0        147       2146
-/+ buffers/cache:       4040       2444
Swap:         8543          0       8543


The third column, 0, is the amount of swap in use.

A healthy box will use up all the RAM available, and you wont see swap in use (you might see a tiny amount, some applications can force themselves to swap, so if its a tiny percentage of swap thats normal too).


Thanks Mike. I missed it when I posted, but I now see (via ASL) that almost 1gb of swap is being used. Is that still considered a tiny percentage?

_________________
CentOS 6.3 (2.6.32.60-40.art.x86_64)
ASL 3.2.13-30.el6.art
Webmin 1.6.2
Virtualmin 3.99.gpl
Apache 2.2.15
PHP 5.3.3 (mod_fcgid/2.3.7)


Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Mon Jun 18, 2012 12:42 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3242
Location: Chantilly, VA
Quote:
Thanks Mike. I missed it when I posted, but I now see (via ASL) that almost 1gb of swap is being used. Is that still considered a tiny percentage?


Thats hard to say. Thats a roll up, what does free -m show?

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Mon Jun 18, 2012 2:06 pm 
Offline
Forum Regular
Forum Regular

Joined: Tue Jun 09, 2009 12:57 pm
Posts: 133
mikeshinn wrote:
Thats hard to say. Thats a roll up, what does free -m show?


Code:
> free -m
             total       used       free     shared    buffers     cached
Mem:          6484       6274        210          0        128       2976
-/+ buffers/cache:       3169       3315
Swap:         8543          6       8537

_________________
CentOS 6.3 (2.6.32.60-40.art.x86_64)
ASL 3.2.13-30.el6.art
Webmin 1.6.2
Virtualmin 3.99.gpl
Apache 2.2.15
PHP 5.3.3 (mod_fcgid/2.3.7)


Top
 Profile  
 
 Post subject: Re: Memory usage grows to almost 4gb with only Virtualmin &
Unread postPosted: Mon Jun 18, 2012 5:12 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin
User avatar

Joined: Thu Feb 07, 2008 7:49 pm
Posts: 3242
Location: Chantilly, VA
You're find, you aren't even using a tiny tiny fraction of your real swap:

Code:
Swap:         8543          6       8537


Third coumn, is "6" or 6 megabytes. So you arent really using any swap at all.

Your system is healthy and fine.

_________________
Michael Shinn
Atomicorp - Security For Everyone

Co-Author of Troubleshooting Linux Firewalls.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 8 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group