monit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CPU usage explained


From: Feighen Oosterbroek
Subject: CPU usage explained
Date: Thu, 25 Nov 2010 16:24:04 +0200 (SAST)

hey

Can somebody explain to me how I get the numbers for the CPU usage in monit status. I have looked at the following:

1) ps aux | grep mysql
2) top
3) monit status

and all 3 show varying values for the CPU percent. I do understand that I they will be slightly different as I can't run all 3 at exactly the same time. I would just like to know how the variables are calculated inside monit so that I can stick to using the correct values for if cpu usage > x% for 3 cycles then restart. I've had a brief look around on google and see that there are a lot of threads on the CPU usage not shutting down process x, but nothing on how monit calculates the CPU usage.

Examples
Process 'mysql'
  status                            running
  monitoring status                 monitored
  pid                               28989
  parent pid                        1
  uptime                            50m
  children                          0
  memory kilobytes                  278808
  memory kilobytes total            278808
  memory percent                    6.8%
  memory percent total              6.8%
  cpu percent                       2.9%
  cpu percent total                 2.9%
  port response time                0.000s to 127.0.0.1:3306 [DEFAULT via TCP]
  data collected                    Thu Nov 25 16:31:32 2010


ps aux | grep mysql
mysql    28989  0.8  6.8 1495508 278480 ?      Ssl  15:41   0:26 /usr/sbin/mysqld

top
28989 mysql     20   0 1460m 271m 7216 S   32  6.9   0:19.07 mysqld

Thanks and kind regards
Feighen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]