Meng says Tony trees CPU usage on Kengpian

  Although cgroup control of the CPU usage of all processes in this cgroup, but from the perspective of the operating system, regardless of whether the process is part of a child under cgroup, is still a common host's CPU. Therefore, CPU monitor the process on the host CPU will be able to obtain monitoring metrics process.
  Commonly used monitor CPU command on Linux is the top. The principle is to obtain top CPU CPU monitoring at time1 cumulative total time from the moment when starting countAll1 total and busy time countBusy1, then time2 get CPU time and total time countAll2 total busy time countBusy2, finally subtracting the difference between the time of busy the total time difference obtained in this time1 time2 occupancy period to the CPU cycle. Namely:
  CPU occupancy rate (%) = (countBusy2 - countBusy1) / (countAll2 - countAll1) 100 process the same way, two at a time are obtained total time each process is busy and countProcBusy1 countProcBusy2, the process CPU utilization is obtained:
Meng says Tony trees CPU usage on Kengpian
  process CPU occupancy rate (%) = (countProcBusy2 - countProcBusy1) / (countProcAll2 - countProcAll1)
100 the first line is meant the total CPU usage, specific parameters:
  therefore, the currently selected time1,3 seconds time2, countAll = user + nice + system + idle + iowait + irq + softirq + stealstolean + guest + guest_nice. countBusy is subtracted countAll idle value, so all the required values on the first formula above together, can be directly calculated.
  The second row, the third row is for each logical CPU usage, there are two logical CPU write down, and the number of logical core CPU of the CPU and the display mode irix solaris related.

Guess you like

Origin blog.51cto.com/14519876/2432961