Martin Pala wrote:
Monit monitors just the physical memory usage (no swap).
When the system starts to swap heavily, it is bad for performance
no matter how much swap you have. If you know that the memory
shortage on you system can be solved by restarting one process,
then you should probably check this particular process' memory
usage, since there will be most probably relationship. If you are
sure that the system wide check is the right solution, the you can
use something like this:
Basically I have a memory leak that will be fixed but until then I
need a short term fix.
--8<--
check system myhost
if memory usage > 95% then exec "/bin/pkill badguy"
--8<--
The problem here surely is that 2.6 Linux kernel will buffer as
much memory as is needs, so 95% wouldn't that unusual on our servers.
Or if the badguy is monitored by monit, then:
--8<--
check system myhost
if memory usage > 95% then exec "/bin/bash -c '/usr/bin/monit
restart badguy'"
check process badguy ...
start ...
stop ...
--8<--
Thanks, that is helpful.
Dave
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general