LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-11-2011, 10:01 PM   #1
karlochacon
Member
 
Registered: Dec 2006
Posts: 109

Rep: Reputation: 17
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
 
Old 07-12-2011, 12:02 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
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'
 
Old 07-12-2011, 01:03 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.
 
Old 07-12-2011, 09:51 AM   #4
karlochacon
Member
 
Registered: Dec 2006
Posts: 109

Original Poster
Rep: Reputation: 17
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
 
Old 07-12-2011, 08:52 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.
 
Old 08-13-2011, 03:49 PM   #6
toaravind
LQ Newbie
 
Registered: May 2008
Posts: 21

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory and swap usage ? czezz Solaris / OpenSolaris 6 09-03-2008 04:51 AM
Difference between resident memory,shared memory and virtual memory in system monitor mathimca05 Linux - Newbie 1 11-11-2007 04:05 AM
High Swap Memory Usage rickylim Solaris / OpenSolaris 3 07-02-2006 05:27 PM
Memory / Swap Usage RoaCh Of DisCor Linux - Newbie 16 05-19-2005 02:45 PM
memory/swap usage koy Linux - Newbie 2 05-18-2004 11:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration