memory metric to monitor memory usage or swap?
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 ?
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'
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.
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
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.
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.
|All times are GMT -5. The time now is 04:22 PM.|