DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

Top: Show CPU usage on all cores in linux

October 24, 2017 DbAppWeb Admin

In Linux, the command top will show you an aggregation of the CPU usage by default. If your processor is multicore and you want to see the statistics on each core of that multi-core processor then you can do this within the top.

Normal top command output:

top - 12:54:17 up 90 days, 18:40,  2 users,  load average: 0.24, 0.33, 0.41
Tasks: 737 total,   1 running, 736 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.6%us,  0.2%sy,  0.0%ni, 99.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  98956160k total, 95395364k used,  3560796k free, 25053208k buffers
Swap: 100663292k total,   152048k used, 100511244k free, 32792224k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 64805 webfrm    20   0  364m  19m 9908 S 10.0  0.0   0:03.08 phpfcgi
  5315 root       0 -20 52176  16m 1488 S  1.0  0.0   1342:57 scopeux
 64775 postgres  20   0  308m  45m  40m S  0.7  0.0   0:28.46 postgres
 64736 postgres  20   0  308m  45m  39m S  0.3  0.0   0:28.49 postgres
 64738 webfrm    20   0  877m  42m  11m S  0.3  0.0   0:18.39 frm.fcgi
 64739 webfrm    20   0  877m  42m  11m S  0.3  0.0   0:17.74 frm.fcgi
 64745 webfrm    20   0  877m  28m  11m S  0.3  0.0   0:18.51 frm.fcgi
 64747 webfrm    20   0  877m  42m  11m S  0.3  0.0   0:17.86 frm.fcgi
 64748 webfrm    20   0  877m  42m  11m S  0.3  0.0   0:16.71 frm.fcgi
 64754 webfrm    20   0  877m  42m  11m S  0.3  0.0   0:21.09 frm.fcgi
 64759 postgres  20   0  309m  45m  39m S  0.3  0.0   0:28.11 postgres
 64761 postgres  20   0  309m  46m  40m S  0.3  0.0   0:28.90 postgres
 64762 postgres  20   0  308m  46m  40m S  0.3  0.0   0:30.01 postgres

After running the top command hit the 1 (numeric 1) and you will be able to see the usage of all the CPUs individually. In this case, my server has 24 CPUs which are being shown after hitting the key 1.

top - 12:55:06 up 90 days, 18:41,  2 users,  load average: 0.35, 0.34, 0.41
Tasks: 737 total,   1 running, 736 sleeping,   0 stopped,   0 zombie
Cpu0  :  3.7%us,  1.1%sy,  0.0%ni, 95.2%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st
Cpu1  :  0.2%us,  0.8%sy,  0.0%ni, 99.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu2  :  1.1%us,  0.2%sy,  0.0%ni, 98.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu3  :  0.1%us,  0.2%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu4  :  0.1%us,  0.3%sy,  0.0%ni, 99.4%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu5  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu6  :  0.1%us,  0.1%sy,  0.0%ni, 99.6%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu7  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu8  :  0.0%us,  0.0%sy,  0.0%ni, 99.8%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu9  :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu10 :  0.2%us,  0.1%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu11 :  0.0%us,  0.2%sy,  0.0%ni, 99.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu12 :  0.8%us,  1.0%sy,  0.0%ni, 98.2%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu13 :  0.1%us,  0.4%sy,  0.0%ni, 99.3%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu14 :  1.2%us,  0.4%sy,  0.0%ni, 98.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu15 :  1.9%us,  0.3%sy,  0.0%ni, 97.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu16 :  0.1%us,  0.1%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu17 :  0.1%us,  0.1%sy,  0.0%ni, 99.8%id,  0.1%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu18 :  0.7%us,  0.6%sy,  0.0%ni, 98.5%id,  0.2%wa,  0.0%hi,  0.1%si,  0.0%st
Cpu19 :  0.4%us,  0.2%sy,  0.0%ni, 99.3%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu20 :  0.1%us,  0.0%sy,  0.0%ni, 99.9%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu21 :  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Cpu22 :  0.4%us,  0.2%sy,  0.0%ni, 99.3%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st
Cpu23 :  0.1%us,  0.3%sy,  0.0%ni, 99.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  98956160k total, 95411972k used,  3544188k free, 25053280k buffers
Swap: 100663292k total,   152048k used, 100511244k free, 32799164k cached

   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
     7 root      RT   0     0    0    0 S 21.9  0.0   1008:16 migration/1
  5315 root       0 -20 52176  16m 1488 S  9.4  0.0   1342:59 scopeux
 64760 postgres  20   0  309m  46m  40m S  1.0  0.0   0:28.07 postgres
 64767 postgres  20   0  309m  45m  39m S  1.0  0.0   0:27.99 postgres
116953 root      20   0  308m  11m 9248 S  1.0  0.0   0:00.03 html2pdf
 64745 webfrm    20   0  877m  28m  11m S  0.7  0.0   0:18.56 frm.fcgi
 64749 webfrm    20   0  876m  24m  10m S  0.7  0.0   0:16.41 frm.fcgi
 64756 webfrm    20   0  877m  41m  10m S  0.7  0.0   0:17.06 frm.fcgi

 

Prev Article
Next Article
Tags:Hardware Linux Sys Admin

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com