SReclaimable should not be included in system memory usage
Say I have a check for my system like this
check system myserver
if memory > 10 GB for 5 cycles
then alert
Then monit complains if the limit is exceeded due to filesystem memory usage. This is not very helpful; I want the filesystem to use all memory for caching unless it is otherwise needed. What I want to monitor is the amount of memory used by processes. Monit ought to keep these two kinds of memory usage apart.
Comments (10)
-
repo owner -
reporter Sorry, for leaving this out. This is monit 5.8.1 on Linux (Debian/testing) and apparently Cached was not subtracted.
-
repo owner Please can you post output from /proc/meminfo?
Was Monit installed from the official source code or precompiled binary or using some 3rd party package? (possibly with some modifications)
Monit always subtracts Cached as you can see in src/process/sysdep_LINUX.c => if there are no 3rd party modifications of memory usage formula, your kernel most probably presents memory usage in some unexpected format ... which kernel version it is?
-
reporter I've tried, but I can't reproduce the problem. So let's close it.
-
reporter - changed status to resolved
Can't reproduce.
-
reporter - changed status to open
I've tracked down the cause for the memory consumption. It was the kernel's Slab allocation. I think monit should subtract SReclaimable from the consumed memory.
Sorry for the mess.
-
reporter - changed title to SReclaimable should not be included in system memory usage
Changed title from (erroneous) "Filesystem cache" to "SReclaimable".
-
reporter Also, for a system check it is possibly more useful not to check against memory consumption, but instead check against MemAvailable.
-
repo owner Thanks for report, we have modified Monit to subtract SLAB reclaimable memory.
You can get the development snapshot here: https://bitbucket.org/tildeslash/monit/get/master.tar.gz
To compile:
tar -xzf master.tar.gz cd tildeslash* ./bootstrap ./configure make
You can install the binary using "make install" (by default goes to /usr/local/bin/)
-
repo owner - changed status to resolved
- Log in to comment
Monit subtracts the buffer/cache from the system memory usage ... for example on Linux it takes the system memory informations from /proc/meminfo and computes the usage as: (MemTotal - MemFree - Buffers - Cached). Similarly on other platforms.
What platform is it related to?