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 07-31-2012, 03:29 PM   #1
Gödel
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Rep: Reputation: Disabled
Questions on measuring CPU on Windows and Linux (for comparison)


Hello

I am a happy linux user since over one year now. I am getting happier and happier with every release of my favorite linux distribution and so I am thinking of completely switching to linux, as everything despite my fingerprint scanner works perfect on my install. Although there is one thing left that worries me: If I run top in the shell and compare the cpu percentage of an individual process to the same process running on windows, there seems to be a big difference (In windows I look at the processes Tab in Taskmanager). But if I compare the percentage value (general, meaning not of a special process) shown in top under the line CPU(s) with the value shown by Windows under Performance they are approximately the same. So my question now would be:
How does Windows Task Manager measures CPU usage and how does top? What does the CPU(s) line say? Is it relative to the maximal clock speed of all processor cores?
The only theory I have that would explain this ist, that Windows measures under the process tab always relative to the maximum performance of the processor while the cpu percentage shown by top is always relative to the current clock speed of the core the process is running at the moment. Is this theory true? If not, how can I compare CPU usage between these two platforms?
I hope someone could explain these things to me and I hope you understand what I mean, because my English is not the best, I am sorry for that.

Thanks in advance!

Last edited by Gödel; 07-31-2012 at 03:32 PM.
 
Old 07-31-2012, 03:38 PM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
CPU usage in top, when looking at an individual process, is relative to one CPU's worth of power. So 100% means it's using one CPU core to the fullest. Therefore a quad core CPU can be running happily at 400% CPU usage according to top, when looking at the individual process. Multi-threaded processes will often do this, in fact, and report a "CPU Usage" of 3-400% or higher, depending on how many cores they're consuming.

Windows Task Manager shows values relative to the total power of all CPU cores.

In other words, if you had a dual core CPU, and one process consuming one complete core, top would show 100% CPU usage for that process, while Windows TM would show 50%.

I have a 12-core machine here with hyper threading (24 virtual cores). When it's really loaded up, you'll often see 10-12 processes in top each consuming 100% CPU. Doing the same in Windows would only show about 4% CPU for each process.

Last edited by suicidaleggroll; 07-31-2012 at 03:41 PM.
 
2 members found this post helpful.
Old 08-01-2012, 02:51 AM   #3
Gödel
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for your reply!
Is there a way to measure cpu in linux similar to the windows way of measuring? So that I can compare results better?
What about the clock speed of one core? Is the percent value relative to the maximal clock speed of the core or to the current?
more /proc/cpuinfo | grep MHz often shows me all cores (4 with hyper theading 8) running on 800Mhz, while the maximum is 2,3 Ghz for each.
I would be very thankful if you could show me an exact way of comparing cpu consumption between Windows and Linux (for both, all processes together and individual processes)
I have often seen reviews where the author compared the percentage shown in top for a processes with the percentage shown in task manager! No wonder that Linux always looses in these comparisons!

Thank you in advance!

Last edited by Gödel; 08-01-2012 at 02:54 AM.
 
Old 08-01-2012, 04:11 AM   #4
segmentation_fault
Member
 
Registered: Sep 2008
Location: Ioannina, Greece
Distribution: Gentoo
Posts: 332

Rep: Reputation: 55
I think the percentage you see on top is relative to max core clock and not the current.

Also, on task manager there is an option to display one graph per cpu. That will give you a more accurate image of cpu consumption.
 
Old 08-01-2012, 04:18 AM   #5
Gödel
LQ Newbie
 
Registered: Jul 2012
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for reply!
Thats no option to determine the cpu consumption exactly.
 
  


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
[SOLVED] CPU comparison Whatif Linux - General 4 12-05-2010 11:50 AM
LXer: Measuring Heavy CPU Usage Over Time On Linux And Unix LXer Syndicated Linux News 0 03-31-2009 07:00 AM
CPU comparison satimis Linux - Hardware 2 05-13-2006 07:07 PM
threadwise measuring of CPU/MEM usage (prstat) raees Linux - Software 1 06-28-2005 08:32 PM
measuring cpu- and tower-temperature? ungua Linux - Software 3 10-04-2004 04:06 AM

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

All times are GMT -5. The time now is 04:19 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