LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-19-2010, 11:52 PM   #1
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Rep: Reputation: 30
CPU usage over 100%


I use "top" to check the existing resource , but I found that the CPU usage over 100% ( eg. 100.1 , 100.8 ) , can advise what is wrong , is it normal ?

besides , can I control the maximum % of CPU usage , for example , it I want all process can not use more that 50% CPU , what can i do ? thx
 
Old 08-20-2010, 12:01 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

When you're looking at top then you can definetely see which process(es) are 'eating up' your CPU. If it's constantly at 100% then you do have a problem. You can try restarting the process that's consuming all CPU and see if that helps. Providing more information about what process(es) are putting it at 100% would be very usefull.

Kind regards,

Eric
 
Old 08-20-2010, 12:21 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Top is a sampler - rounding error, especially at the boundaries, is always a possibility.

For limiting particular processes, have a look at cpulimit - a userland solution.
cgroups is also an option.
 
Old 08-20-2010, 02:28 AM   #4
elainelaw
Member
 
Registered: Jan 2008
Posts: 258

Original Poster
Rep: Reputation: 30
thx reply , but why the CPU usage over 100% ?
 
Old 08-20-2010, 02:31 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

That's hard to say if you don't specify which process is putting your CPU at 100%. Can you post some output of the top command or at least which process is consuming your CPU as asked in my previous post?

Kind regards,

Eric
 
Old 08-20-2010, 02:46 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

Are we actually talking about a single cpu/core or multiple cpu's/cores? I've seen top show 390% cpu usage on a quad core cpu.

Top shows single state by default (all cpu's/cores together), press 1 (one) to see separate view. As syg00 already mentioned, rounding "errors" do make it possible to show slightly over a 100% for 1 specific cpu.

Hope this helps.
 
Old 08-20-2010, 06:18 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
On my multi-core CPU, if a process hogs the CPU it only takes one core to 100% and the others are free, even if there is something wrong with the process and it shouldn't be using so much CPU.
 
Old 08-21-2010, 08:02 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
If the mis-behaving proc was multi-threaded it could peg all the cores ...
 
Old 08-21-2010, 08:05 PM   #9
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Perhaps one process is thrashing one core, and the other(s) is (are) experiencing idle activity? Rarely is a CPU truly at rest...

As for me, top averages the loads of the virtual cores into a single "system load" indicator, i.e. it shows around 25% when one virtual core is totally busy. I say "virtual" because this system's CPU is an Intel Core i5, which is multithreaded dual-core. Two physical cores, but the OS sees four.

Last edited by MrCode; 08-21-2010 at 08:09 PM.
 
Old 08-21-2010, 08:11 PM   #10
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
For example I have a quad-core CPU with hyper-threading, so the OS sees 8 CPUs. So even when the CPU is at 12.5% that means that a process is hogging the CPU or got stuck in an infinite loop.
 
Old 08-21-2010, 08:14 PM   #11
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
I have a quad-core CPU with hyper-threading, so the OS sees 8 CPUs
[OT]Do you ever really use all that computing power? A Core i7 would be awesome for mass virtualization...this machine maxes out if I have 3 VMs booting/highly loaded at once. [/OT]
 
Old 08-22-2010, 06:38 AM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by MrCode View Post
[OT]Do you ever really use all that computing power? A Core i7 would be awesome for mass virtualization...this machine maxes out if I have 3 VMs booting/highly loaded at once. [/OT]
Not really, but sometimes I have a VM or two in the background and am compiling something.
 
  


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
cpu usage 100% ahhkyyda Linux - Enterprise 2 09-03-2009 07:26 AM
FF 2.0 100% CPU Usage cexshun Slackware 12 04-05-2007 01:11 AM
CPU Usage goes to 100% when pthread_cond_wait is being used zen_buddha Programming 0 10-13-2005 03:48 AM
CPU usage 100% ecsfan Red Hat 17 11-19-2003 03:06 PM
100 % CPU usage ???? rolandi Linux - Newbie 1 10-07-2003 11:52 PM

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

All times are GMT -5. The time now is 02:10 PM.

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