god icon indicating copy to clipboard operation
god copied to clipboard

CPU usage is measured incorrectly

Open dgutov opened this issue 11 years ago • 3 comments

PortablePoller#percent_cpu uses the ps command, which has this note in the man page:

CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and it does not conform to the standards that ps otherwise conforms to. CPU usage is unlikely to add up to exactly 100%.

The logic in SlashProcPoller#percent_cpu also seems to amount to the same effect.

AFAICT, this makes the cpu_usage condition almost entirely useless in real-world conditions, because even if the process in question is currently hogging a whole CPU core by itself, and even if I set the threshold to 50% (which very low anyway), if the process had been working successfully for a week before only generating 1-2% CPU load, it will take another week for God to notice the excessive usage.

dgutov avatar Dec 03 '14 20:12 dgutov

you may want to try eye, which is measured cpu correctly.

kostya avatar Dec 04 '14 16:12 kostya

@kostya Yes, thanks, we're going to evaluate Eye one day.

For the time being, though, I'd prefer to spare other people the trouble of figuring out why CPU usage monitoring is broken here.

Delegating it to Sigar, like Eye does, is one option. Removing the feature shouldn't be too bad also, since apparently no one is really using it, years after it's been introduced. At the very least, it deserves a caveat section at the homepage.

dgutov avatar Dec 04 '14 17:12 dgutov

Is there any update on this one?

tdi avatar Jan 18 '16 20:01 tdi