[CentOS] CPU usage over estimated?

Theo Band theo.band at greenpeak.com
Fri Jun 5 07:48:17 UTC 2009


Scott Silva wrote:
> on 6-4-2009 5:37 AM Theo Band spake the following:
>   
>> I have a quad core CPU running Centos5.
>>
>> When I use top, I see that running processes use 245% instead of 100%.
>> If I use gkrellm, I just see one core being used 100%.
>>
>>     
> This one is easy. 4 cpu's, 100% total each, a maximum of 400%.
>
> Since one core is at 100%, the other 145% is spread across the other 3 cores.
>   
Not quite. If I run 4 processes (4 times cpuburn-in) I see this:

Cpu(s): 50.2%us,  0.9%sy, 48.9%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si, 
0.0%st
14696 thba      25   0  2064  984 1080  308 R 244.9  0.0   0:40.57
cpuburn-in
14695 thba      25   0  2064  984 1080  308 R 243.2  0.0   0:43.21
cpuburn-in
14698 thba      25   0  2064  984 1080  308 R 242.9  0.0   0:34.47
cpuburn-in
14697 thba      25   0  2068  988 1080  308 R 162.0  0.0   0:25.86
cpuburn-in
14402 made      31  15  117m  24m  93m  11m R 40.9  0.4   1:11.56
eldo_64.exe
13746 kedo      39  15  696m 611m  85m  23m R 40.3 10.3  34:29.50
common_shell_ex

So in total 100% (first line) and counting the process %
(244.9+243.2+242.9+162.0+40.9+40.3=974%). One of the cores runs three
processes also totaling up to (162+40.9+40.3)=243%
To me it looks like all values are just multiplied by 2.43 (400%x2.43=972%)

I did disable hyperthreading in the bios. The machine would otherwise
show up with 8 CPU. Hyperthreading does benefit my application.

Theo



More information about the CentOS mailing list