[GLLUG] Monitoring memory usage

John Edwards john at cornerstonelinux.co.uk
Wed Oct 23 12:14:10 UTC 2024


Hi

On Wed, Oct 23, 2024 at 10:26:28AM +0100, Martin A. Brooks via GLLUG wrote:
> On 2024-10-23 09:40, Henrik Morsing via GLLUG wrote:
>> How do you do it? (If you do monitor memory).
> 
> I use a monitoring tool.  Icinga for "what's happening now?" and Munin for
> "what did this look like 3 months ago?"

Both good tools, although the problem I usually find is what
measurement to use to create an alert (which may be what Henrik is
looking for as well).

It used to be when the machine started to swap for running programs
then performance was reduced, so swap was the thing to monitor.

But I've found recent kernels (probably since 5.x) tend to swap out
any unused programs in favour of caching the filesystem (which is
usually the right thing to do to increase performance).

Odd thing is that currently the kernel does this even when
/proc/sys/vm/swappiness is set low (10 or even 1), and will happily
continue until all swap is used (at which point Nagios/Icinga alerts,
even though there is potential lots of RAM available but used for cache).


The default 'check_swap' in the Nagios/Icinga 'monitoring-plugins'
Debian package only seems to handle total amount of swap (either as
percentage or absolute numbers).

Munin can measure swap pages being written or read, which gives a
better idea of how much the swap is being actively used, but it does
not handle alerts as well as Nagios/Icinga (I think it can send email,
but does not have its own acknowledge status).

So has anyone met a Nagios/Icinga monitoring plugins which can measure
the swap I/O levels rather than swap used (maybe through /proc/vmstat)?


Also Munin seems to be able split memory use into applications,
system, I/O wait, cache, etc. So I'm wondering if there might be a
Nagios/Icinga monitoring plugins which can do the same and alert if a
certain item (eg application memory) reaches a certain level.


Of course the other alternative is to just not use swap at all, but
that seems like a waste of a potential resource.



-- 
#---------------------------------------------------------#
|    John Edwards   Email: john at cornerstonelinux.co.uk    |
#---------------------------------------------------------#
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20241023/08ad5e24/attachment.sig>


More information about the GLLUG mailing list