LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   memory metric to monitor memory usage or swap? (http://www.linuxquestions.org/questions/linux-newbie-8/memory-metric-to-monitor-memory-usage-or-swap-891200/)

karlochacon 07-11-2011 10:01 PM

memory metric to monitor memory usage or swap?
 
hi guys

I am having a doubt about memory monitoring on linux system
what I should be monitoring? memory usage? o swap usage?

I am using some monitoring tools but I am confused to what monitor for alerting

for example this case
looks the memory usage is very high and it's like that all the time
so is it memory usage or swap usage? in case swap is the metric what should be threshold ?

Code:

Mem:  2738708k total,  2620784k used,  117924k free,  107872k buffers
Swap:  2104472k total,      240k used,  2104232k free,  837772k cached

thanks a lot guys

kbp 07-12-2011 12:02 AM

You need to remember that the file system cache will use up all the spare memory and release it when required, it's easier to see accurate memory usage via 'free -m'

chrism01 07-12-2011 01:03 AM

As above, all the RAM will be used as needed and released on the same basis.; don't worry about it.
As for swap, its (more or less) an overflow for RAM. A small amt (as shown) is perfectly normal.
If it starts increasing and continues to rise, then you've got a problem ... if it fills up your OOM may kick in or the machine will freeze.
Its pretty unusual, but it can happen eg not free-ing allocated memory blocks in an app.

karlochacon 07-12-2011 09:51 AM

well I am asking this because one of my friends work in AIX and they say they don't monitor memory usage they monitor swap usage

25% swap usage - WARNING
45% swap usage - CRITICAL

I just want to know which to monitor on linux for alerting process? any idea what parameter to use in this case?

I code added from top is just a simple example for this question

chrism01 07-12-2011 08:52 PM

Exactly, your friend and I agree. The amt of used swap you want to trigger on is entirely personal; however....
some people really swamp their systems (in normal usage), so a lot of swap is 'normal' for them.
As per my prev post, really you want to check if its keeps increasing, rather than just reaching an arbitrary figure.
Of course you could (also) have a final emergency limit eg 80%, where it starts (strongly) notifying you.
Its really your choice what you check.

toaravind 08-13-2011 03:49 PM

What is the best practice to monitor swap

1) (Free +cache)/Total > 90% is critical or
2) (Free/Total) > 90% is critical. (I am not considering the cache memory).

I have to fine tune my monitoring parameter accordingly.
Thanks in advance.

Aravind


All times are GMT -5. The time now is 03:46 AM.