I am trying to understand what does %CPU means when I run top.

I am seeing %CPU for my application as 400 or 500 most of the times.

Does anyone knows what does this mean?

What number is a high number?

19080 david 20 0 27.9g 24g 12m S 400 19.7 382:31.81 paper_client

lscpu gives me below output:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                32
On-line CPU(s) list:   0-31
Thread(s) per core:    2
Core(s) per socket:    8
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 45
Stepping:              7
CPU MHz:               2599.928
BogoMIPS:              5199.94
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              20480K
NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31
  • 1
    I think you can also use cat /proc/cpuinfo. – Faheem Mitha Jul 18 '14 at 10:01

%CPU -- CPU Usage : The percentage of your CPU that is being used by the process. By default, top displays this as a percentage of a single CPU. On multi-core systems, you can have percentages that are greater than 100%. For example, if 3 cores are at 60% use, top will show a CPU use of 180%. See here for more information. You can toggle this behavior by hitting Shifti while top is running to show the overall percentage of available CPUs in use.

Source for above quote.

You can use htop instead.

To answer your question about how many cores and virtual cores you have:

According to your lscpu output:

  • You have 32 cores (CPU(s)) in total.
  • You have 2 physical sockets (Socket(s)), each contains 1 physical processor.
  • Each processor of yours has 8 physical cores (Core(s) per socket) inside, which means you have 8 * 2 = 16 real cores.
  • Each real core can have 2 threads (Thread(s) per core), which means you have real cores * threads = 16 * 2 = 32 cores in total.

So you have 32 virtual cores from 16 real cores.

Also see this, this and this link.

| improve this answer | |
  • 1
    Thanks for suggestion. How can I find out how many cores and virtual cores I have? If I press 1 while top is running I can see from CPU0 - CPU31. – david Jul 18 '14 at 8:43
  • Use these commands: superuser.com/a/178497/333431. – polym Jul 18 '14 at 8:46
  • Ok I got number of CPU cores per CPU as 8 and I got number of physical CPUs as 2. – david Jul 18 '14 at 8:52
  • 1
    lscpu is easier in most modern distros – Dani_l Jul 18 '14 at 8:57
  • @user2809564 Have a look at my updated answer. Don't forget to accept and upvote answers that helped you understand/fix a problem. That's how stackexchange works :)! – polym Jul 18 '14 at 9:55

It means you have a lot of cores. One core at max is 100%. So the highest it can be is number_of_cores × 100%.

You may want to look at why your app it as 400%.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.