On Sat, 28 Mar, 2009 at 23:11:52 +0100, Anders Johansson wrote:
On Saturday 28 March 2009 22:48:53 Chuck Payne wrote:
Does any one have a good script I can use, or can advise me on what is best practise for monitor memory.
In general I'd say that 'free' vs. 'used' memory is not nearly as important as whether or not the system is swapping. I'm certainly no expert on linux memory management, but AFAIK the overall strategy concerning RAM usage is that: Memory is there to be used. Since it's always a possibility that 'something' in memory is going to be needed 'next', there's no reason to evacuate it until such a time when 'something else' needs the space. So what it comes down to is; If there's enough physical RAM to keep all relevent 'somethings' in memory, then everything is fine regardless of how many percent it takes up. If not, then the system has to swap between physical memory and swapspace on disk, which carries a performance penalty.
There are tools for monitoring systems that were written by people who understand linux memory management. If you want to write your own script, you can just monitor for when the "free" value on the "-/+ buffers/cache" line gets too low, but I would recommend using one of the existing monitoring tools. For example, have a look at nagios
While Nagios can be somewhat intimidating when you first lay eyes on it, it's a very good monitoring system, and definitely worth looking in to. It may be overkill for the imediate task at hand, but once you get the hang of it you might want to monitor other stuff too. In any event you might save yourself some scripting/research time by installing nagios-plugins and just call the pertinent plugins directly: jon@zd8k110:~> /usr/lib/nagios/plugins/check_swap -w 95 -c 90 SWAP OK - 100% free (1027 MB out of 1027 MB) |swap=1027MB;0;0;0;1027 /jon -- YMMV -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org