Hi,
your guess is correct, currently the cpu test checks for total including
child processes, this is documented in monit manual as well:
--8<--
Process only resource tests:
CPU is the CPU usage of the process and its children in
parts of hundred (percent).
--8<--
I think we should change this and align it with memory test behavior,
where by default it checks for the memory of the process itself and
optionally including child.
Current syntax ... example:
if cpu > 60% then ... (including child processes)
if mem > 100 MB then ... (process itself)
if totalmem > 1000 MB then ... (including child processes)
=> we can:
1.) add:
if totalcpu > 60% then ... (including child processes)
2.) change the "if cpu ..." to test just cpu usage of the process
itself. We will have to warn users about the behavior change, but it is
possible that many users thinks that it works this way already. The
"system" service type should handle both "cpu" and "totalcpu" same way.
What does other developers and monit users think?
Thanks,
Martin
Ismo Tanskanen wrote:
Hello to all,
I have weird problem. I use monit to monitor mythtv backend. It works
great.
Problem is, that I have AMD X2 cpu, and monit somehow sees cpu usage
wrong.
Mythbackend sometimes locks and starts using 100% cpu (top reading).
For some reason monit only shows it using 50%. I think this is due X2
cpu.
This is not problem, I have set cpu limit to 45% what works great in
most situations.
But, myth can start processes, like mythtranscode, and mencoder. I
think monit sees them as child processes.
And, when myth starts those processes, monit suddenly sees it using
more than 50% cpu. Are processes using different cpus and monit
calculates summary?
At this situation, monit thinks, that myth has reached cpu usage
limit, and restarts it. This causes problems to because after restart
myth starts those processes again, and again... until whole machine
crashes.
So is there a way to monitor mythbackend process, not it's child
processes for cpu usage?
Thanks,
- Kane
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general