Top: Show CPU Usage on all cores

Written by Benjamin Cane on 2011-08-28

By default the command top will show you an aggregation of the cpu usage. If you want to see the statistics on each core you can do this within top.

Normal top output:

top - 16:39:08 up 23 days, 22:03, 2 users, load average: 0.07, 0.02, 0.00  
Tasks: 88 total, 1 running, 87 sleeping, 0 stopped, 0 zombie  
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st  
Mem: 536684k total, 514528k used, 22156k free, 3976k buffers  
Swap: 1048568k total, 352996k used, 695572k free, 53052k cached

After running top you can hit the 1 key and it will show you all of the cpus individually

top - 16:44:23 up 23 days, 22:09, 2 users, load average: 0.00, 0.00, 0.00  
Tasks: 86 total, 1 running, 85 sleeping, 0 stopped, 0 zombie  
Cpu0 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st  
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st  
Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st  
Cpu3 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st  
Mem: 536684k total, 528108k used, 8576k free, 3944k buffers  
Swap: 1048568k total, 353760k used, 694808k free, 49552k cached

Picture of Benjamin Cane

Benjamin's specialty is keeping the lights on for mission critical systems. He is currently building applications that enable high concurrency financial transactions.

Recently Benjamin published his first book; Red Hat Enterprise Linux Troubleshooting Guide. In addition to writing, he has several Open Source projects focused on making Ops easier. These projects include Automatron, a project enabling auto-healing infrastructure for the masses.


Publications

Identify, capture and resolve common issues faced by Red Hat Enterprise Linux administrators using best practices and advanced troubleshooting techniques

What people are saying:
Excellent, excellent resource for practical guidance on how to troubleshoot a wide variety of problems on Red Hat Linux. I particularly enjoyed how the author made sure to provide solid background and practical examples. I have a lot of experience on Red Hat but still came away with some great practical tools to add to my toolkit. - Amazon Review