Discussion:
[Supervisor-users] CPU monitoring like memory monitoring in memmon in superlance
Steve Piercy - Website Builder
11 years ago
Permalink
Is there a CPU monitoring plugin utility for Supervisor, like
memmon in superlance monitors memory?

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy Website Builder Soquel, CA
<***@StevePiercy.com> <http://www.StevePiercy.com/>
Chris McDonough
11 years ago
Permalink
Is there a CPU monitoring plugin utility for Supervisor, like memmon in
superlance monitors memory?
Theoretically, the data is available. memmon uses "ps" to get the
memory size of prorcesses, and could get the CPU usage data from ps as well.

But CPU usage is typically a lot more dynamic than memory usage, and
some sort of restart trigger based on "using too much (or too little)
CPU" would be very application- and environment-specific, and not easily
generalizable. I think you would be forced to write your own event
listener, possibly starting from the code in memmon.

- C
Aryeh Leib Taurog
11 years ago
Permalink
...
One could monitor cpu time and compare it with real time. That should
be reasonably easy, since both increase monotonically.

On modern linux systems, cgroups also provides a mechanism for
limiting resource consumption, including cpu usage.
Steve Piercy - Website Builder
11 years ago
Permalink
...
Thanks, y'all. I reckoned that monitoring CPU would be a challenge.

I got elbows deep in 'ps' and learned a few things, like -o to
give me pretty output.

ps -u<user> -o pid,pcpu,pmem,command

I'm reading and re-reading cgroups docs, but I'm having a hard
time absorbing it.
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Resource_Management_Guide/ch01.html

Anyone have a "cgroups for Dummies" reference?

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Steve Piercy Website Builder Soquel, CA
<***@StevePiercy.com> <http://www.StevePiercy.com/>
Gustavo Carneiro
11 years ago
Permalink
You might find it easier to use the psutil python module:

https://github.com/giampaolo/psutil


On 2 September 2014 22:17, Steve Piercy - Website Builder <
...
--
Gustavo J. A. M. Carneiro
Gambit Research
"The universe is always one step beyond logic." -- Frank Herbert
Loading...