Linux – Top command – overall cpu usage is lesser than process’ cpu usage

linuxMySQLtop

top - 14:51:31 up 11:24,  5 users,  load average: 0.79, 0.95, 0.97
Tasks: 173 total,   2 running, 171 sleeping,   0 stopped,   0 zombie
%Cpu(s):  9.1 us,  4.5 sy,  0.0 ni, 85.5 id,  0.0 wa,  0.0 hi,  1.0 si,  0.0 st
KiB Mem : 32601524 total, 24374660 free,  2048104 used,  6178760 buff/cache
KiB Swap:  8191996 total,  8191996 free,        0 used. 28478564 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
27018 mysql     20   0 7548496 1.682g  12528 S  91.7  5.4  56:12.75 /usr/sbin/mysqld

Mysql user is using around 91.7% but %cpu is 9.1
What does it mean?

This server is running only mysql

Best Answer

As @c4f4t0r alreydy mentioned, that means you have multiple CPU cores on your machine. You could press 1 and see load per CPU. It should looks like:

top - 11:14:48 up 100 days, 13:14,  1 user,  load average: 1.31, 1.52, 1.60
Tasks: 302 total,   1 running, 301 sleeping,   0 stopped,   0 zombie
Cpu0  : 20.5%us,  6.9%sy,  0.0%ni, 43.2%id, 28.1%wa,  0.0%hi,  0.0%si,  1.3%st
Cpu1  : 12.7%us,  0.7%sy,  0.0%ni, 85.3%id,  0.0%wa,  0.0%hi,  0.0%si,  1.3%st
Cpu2  :  4.6%us,  1.3%sy,  0.0%ni, 92.1%id,  0.0%wa,  0.0%hi,  0.0%si,  2.0%st
Cpu3  : 37.6%us,  5.0%sy,  0.0%ni, 55.4%id,  0.0%wa,  0.0%hi,  0.7%si,  1.3%st
Cpu4  : 42.0%us,  1.0%sy,  0.0%ni, 53.4%id,  2.0%wa,  0.0%hi,  0.0%si,  1.6%st
Cpu5  :  8.9%us,  0.7%sy,  0.0%ni, 89.1%id,  0.3%wa,  0.0%hi,  0.0%si,  1.0%st
Mem:  10127380k total,  9939356k used,   188024k free,   165304k buffers
Swap:     1020k total,     1020k used,        0k free,  3213328k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 9364 mysql     20   0 9858m 5.6g 5068 S 103.6 57.5  40717:04 mysqld
Related Topic