Understanding %CPU while running top command
%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 whiletop
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.
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%.