LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-27-2018, 02:07 AM   #1
sub320
Member
 
Registered: Jan 2016
Posts: 116

Rep: Reputation: 3
About the cpu usage


I found my server have a process that the cpu usage is over 100% , just would like to know why the % could be over 100 ? is it because there are over 1 CPU ?

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

2223 root 20 0 15096 1172 468 S 122.4 0.0 6996:55 sysocpd
 
Old 06-27-2018, 02:14 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
If your CPU has more than core, then the CPU can rise over 100%.

What CPU do you have?
 
Old 06-27-2018, 02:30 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
top display is non-normalised (each process is a percentage of one CPU), so a multi-threaded task can sum to over 100%.
 
Old 06-27-2018, 02:31 AM   #4
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
@OP, are you viewing CPU usage from top ?

Toggle the irix mode (inside top, press I (shift+i)) and see how the output changes. Again, press 1 and see how your individual cores are working.
The irix mode is explained nicely in the man page of top.

Example - (Irix Off)

Code:
top - 12:58:48 up 21 min,  2 users,  load average: 5.37, 4.03, 2.18
Tasks: 229 total,   2 running, 227 sleeping,   0 stopped,   0 zombie
%Cpu0  : 50.8 us,  8.5 sy,  0.0 ni, 29.8 id, 10.8 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  : 54.1 us,  5.7 sy,  0.0 ni, 24.3 id, 15.9 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  : 60.6 us,  4.7 sy,  0.0 ni, 10.1 id, 23.9 wa,  0.0 hi,  0.7 si,  0.0 st
%Cpu3  : 57.2 us,  5.0 sy,  0.0 ni, 32.4 id,  5.4 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16390404 total,  7944188 free,  3999300 used,  4446916 buff/cache
KiB Swap:  3170300 total,  3170300 free,        0 used. 11924736 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND      
 3174 qemu      20   0 2267032   1.1g  11496 S 20.5  7.1   8:10.03 qemu-kvm     
 3027 qemu      20   0 2265840   1.1g  11492 S 19.6  7.2   7:53.00 qemu-kvm     
 1474 root      20   0  347636  84836  64408 R  7.9  0.5   2:40.71 X            
 2771 root      20   0 2507372 373064  36344 S  6.9  2.3   3:15.79 virt-manager 
 2267 root      20   0 3652252 282352  71864 S  5.7  1.7   3:26.57 gnome-shell  
 1509 root     -51   0       0      0      0 S  0.9  0.0   0:21.35 irq/127-nvi+ 
 3306 root      20   0 2033192 199468  81080 S  0.3  1.2   0:45.17 Web Content
Example - (Irix On)

Code:
top - 12:59:23 up 21 min,  2 users,  load average: 5.16, 4.13, 2.28
Tasks: 228 total,   5 running, 223 sleeping,   0 stopped,   0 zombie
%Cpu0  : 53.8 us,  9.9 sy,  0.0 ni, 22.5 id, 13.7 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  : 53.0 us,  5.5 sy,  0.0 ni, 29.3 id, 12.2 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  : 48.6 us,  7.7 sy,  0.0 ni, 23.5 id, 19.7 wa,  0.0 hi,  0.5 si,  0.0 st
%Cpu3  : 47.0 us,  6.6 sy,  0.0 ni, 24.6 id, 21.9 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16390404 total,  7819608 free,  3998068 used,  4572728 buff/cache
KiB Swap:  3170300 total,  3170300 free,        0 used. 11920512 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 3174 qemu      20   0 2267032   1.1g  11496 S  81.8  7.1   8:38.51 qemu-kvm    
 3027 qemu      20   0 2265840   1.1g  11492 S  64.6  7.2   8:20.09 qemu-kvm    
 1474 root      20   0  347636  84836  64408 R  29.8  0.5   2:51.61 X           
 2771 root      20   0 2507372 373064  36344 R  26.0  2.3   3:25.75 virt-manag+ 
 2267 root      20   0 3652252 282660  71864 S  21.0  1.7   3:35.28 gnome-shell 
 1509 root     -51   0       0      0      0 S   3.9  0.0   0:22.70 irq/127-nv+ 
 2791 root      20   0  666936  26212  16664 D   0.6  0.2   0:01.16 gnome-term+ 
 3197 root      20   0 2610212 279036 100128 S   0.6  1.7   0:44.04 firefox
 
Old 06-27-2018, 02:32 AM   #5
sub320
Member
 
Registered: Jan 2016
Posts: 116

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Keruskerfuerst View Post
If your CPU has more than core, then the CPU can rise over 100%.

What CPU do you have?
check by dmidecode -t 4 | grep CPU , I have 2 physical CPU .
 
Old 06-27-2018, 02:48 AM   #6
sub320
Member
 
Registered: Jan 2016
Posts: 116

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Honest Abe View Post
@OP, are you viewing CPU usage from top ?

Toggle the irix mode (inside top, press I (shift+i)) and see how the output changes. Again, press 1 and see how your individual cores are working.
The irix mode is explained nicely in the man page of top.

Example - (Irix Off)

Code:
top - 12:58:48 up 21 min,  2 users,  load average: 5.37, 4.03, 2.18
Tasks: 229 total,   2 running, 227 sleeping,   0 stopped,   0 zombie
%Cpu0  : 50.8 us,  8.5 sy,  0.0 ni, 29.8 id, 10.8 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  : 54.1 us,  5.7 sy,  0.0 ni, 24.3 id, 15.9 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  : 60.6 us,  4.7 sy,  0.0 ni, 10.1 id, 23.9 wa,  0.0 hi,  0.7 si,  0.0 st
%Cpu3  : 57.2 us,  5.0 sy,  0.0 ni, 32.4 id,  5.4 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16390404 total,  7944188 free,  3999300 used,  4446916 buff/cache
KiB Swap:  3170300 total,  3170300 free,        0 used. 11924736 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND      
 3174 qemu      20   0 2267032   1.1g  11496 S 20.5  7.1   8:10.03 qemu-kvm     
 3027 qemu      20   0 2265840   1.1g  11492 S 19.6  7.2   7:53.00 qemu-kvm     
 1474 root      20   0  347636  84836  64408 R  7.9  0.5   2:40.71 X            
 2771 root      20   0 2507372 373064  36344 S  6.9  2.3   3:15.79 virt-manager 
 2267 root      20   0 3652252 282352  71864 S  5.7  1.7   3:26.57 gnome-shell  
 1509 root     -51   0       0      0      0 S  0.9  0.0   0:21.35 irq/127-nvi+ 
 3306 root      20   0 2033192 199468  81080 S  0.3  1.2   0:45.17 Web Content
Example - (Irix On)

Code:
top - 12:59:23 up 21 min,  2 users,  load average: 5.16, 4.13, 2.28
Tasks: 228 total,   5 running, 223 sleeping,   0 stopped,   0 zombie
%Cpu0  : 53.8 us,  9.9 sy,  0.0 ni, 22.5 id, 13.7 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu1  : 53.0 us,  5.5 sy,  0.0 ni, 29.3 id, 12.2 wa,  0.0 hi,  0.0 si,  0.0 st
%Cpu2  : 48.6 us,  7.7 sy,  0.0 ni, 23.5 id, 19.7 wa,  0.0 hi,  0.5 si,  0.0 st
%Cpu3  : 47.0 us,  6.6 sy,  0.0 ni, 24.6 id, 21.9 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem : 16390404 total,  7819608 free,  3998068 used,  4572728 buff/cache
KiB Swap:  3170300 total,  3170300 free,        0 used. 11920512 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND     
 3174 qemu      20   0 2267032   1.1g  11496 S  81.8  7.1   8:38.51 qemu-kvm    
 3027 qemu      20   0 2265840   1.1g  11492 S  64.6  7.2   8:20.09 qemu-kvm    
 1474 root      20   0  347636  84836  64408 R  29.8  0.5   2:51.61 X           
 2771 root      20   0 2507372 373064  36344 R  26.0  2.3   3:25.75 virt-manag+ 
 2267 root      20   0 3652252 282660  71864 S  21.0  1.7   3:35.28 gnome-shell 
 1509 root     -51   0       0      0      0 S   3.9  0.0   0:22.70 irq/127-nv+ 
 2791 root      20   0  666936  26212  16664 D   0.6  0.2   0:01.16 gnome-term+ 
 3197 root      20   0 2610212 279036 100128 S   0.6  1.7   0:44.04 firefox


I used your way to check , the output is below , CPU% is 432.5 , is it mean the process is run by different cores , they sum up into one total cpu usage , so it is much over 100% ?

2223 root 20 0 15096 1172 468 S 432.5 0.0 6996:55 sysocpd
 
Old 06-27-2018, 03:06 AM   #7
Honest Abe
Member
 
Registered: May 2018
Distribution: CentOS 7, OpenSUSE 15
Posts: 420
Blog Entries: 1

Rep: Reputation: 202Reputation: 202Reputation: 202
yes, the process is using multiple CPU cores.

There's a simple way to validate this. See my example of PID 4424-

Code:
[root@AB-Cent7OS ~]# ps -o pid,psr,comm -p 4424
  PID PSR COMMAND
 4424   2 qemu-kvm
[root@AB-Cent7OS ~]# ps -o pid,psr,comm -p 4424
  PID PSR COMMAND
 4424   3 qemu-kvm
[root@AB-Cent7OS ~]# ps -o pid,psr,comm -p 4424
  PID PSR COMMAND
 4424   0 qemu-kvm
See how the PSR changes ?

You can wrap the command in a endless loop (or use watch) and see for yourself. Substitute 4424 with your PID.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script for CPU usage, memory usage, disk partition space and service status reetesh.amity Linux - Server 6 10-12-2015 07:51 PM
Squid 3 near 100% cpu usage and high RAM usage piman Linux - Software 1 11-16-2013 02:20 AM
processes/CPU Usage/Mem Usage desktop wallpaper ceantuco Linux - Newbie 2 04-13-2009 01:14 PM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 08:43 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration