Swap memory treshold - warning - critical
hi guys
the monitoring team is using a tool for monitoring linux boxes and they set an alarm for swap memory to 10%(critical) I really has no idea when swap memory usage is high.... Can someone recommend me a threshold for this? when is warning or critical and this parameters can affect performance in my Suse Linux boxes? for instance 1 box has been having "peaks" of 14% during last days....they don't know if the box has issues but they see the alarms and today another box had a peak of 64% and they are worried should they? basically they told me these 2 boxes should not have peaks like that they should be 0% swap usage....so how they say that thanks a lot |
swap utilization size all by itself doesn't mean that much. swap and physical memory combine to create virtual memory. Applications preallocate address space at start up and by having more virtual memory you can start more things than you could if limited to physical memory.
What you need to know is pageins/pageouts. This is what tells you not just if swap space is being utilized but whether in fact you are "paging" (swap is an old term still used but modern *NIX does paging rather than swapping). If you have a high number of pageouts AND pageins it means that the system is memory constrained so is having to push parts of active processes out to swap and then call them in. Since this reduces memory calls to disk speed it impacts performance. You can see pageins and pageouts with vmstat (si and so columns). vmstat 5 5 Also if you have sar installed and running you can get hourly statistics with "sar -B". It is retarded to say swap should always be 0. If that were the case you wouldn't need to configure swap in the first place. |
Quote:
thanks a lot for this great info and I agree with you about no swap utilization by the way what when I know pages in and pages out are high so I can say my server is memory constraint |
Are these real or virtual systems? Memory management in a virtual machine may be strange and is certainly specific to the type of virtualization.
Quote:
Quote:
How much swap space and how much ram do these systems have? That info would give a little perspective on the % values you reported. Quote:
Quote:
Quote:
If you can run free at a moment when swap usage is "high", you can get a better idea of the overall memory state. If the used swap reported by free is lower than cached ram reported by free, you have moderate to low swap usage. Under those conditions, I think 2GB of free swap space is a pretty safe margin. If the used swap is greater than the cached ram, you should be worrying about both the swap in/out rates for whether the system has enough ram to do its job and the out of memory killer (whether the system has enough swap space for safe operation). In such a system, I do not think 2GB of free swap is enough of a safety margin. |
In addition to MensaWater's advice, you might also look at iostat http://linux.die.net/man/1/iostat.
If the alert system is currently warning you, that's good (in as much as its doing its job), but I'd also recommend graphing swap usage values regularly so that you can see the history. This will help you pin down which process(es) is/are causing the issue. For example we currently use Nagios for alerting & Cacti for historical graphing/tending. |
All times are GMT -5. The time now is 09:53 AM. |