LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-07-2014, 09:57 PM   #1
robgeek
Member
 
Registered: Oct 2013
Posts: 37

Rep: Reputation: Disabled
Conky: CPU usage different that htop shows me.


Hi!
I'm using Debian Wheezy with OpenBox in a very old pc, Pentium4 3Ghz.
I would like my Conky1.9 shows my the correct usage of my CPU.
So, the part of conkyrc file that does this is "${cpu}". But when i run htop to make a comparation, htop shows me almost twice of usage of my cpu that Conky does!

Which one is correct and how i can show the correct usage?

Thank you!

Screenshot of my htop and conky on the top of screen.(This time he showed a little bit more of cpu usage that Conky, but he always shows me almost twice of usage)

http://postimg.org/image/3ta7hhrpv/

Last edited by robgeek; 06-09-2014 at 11:35 AM.
 
Old 06-07-2014, 11:31 PM   #2
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
The ${cpu} value is showing the averaged use. If you look at the values in htop, there are two cores, conky is averaging that.

If you want to show each individual core, add to your conky something like this:
Code:
CPU0 ${cpu cpu0}% | CPU1 ${cpu cpu1}% |
which should show almost identical values as seen in htop.
 
Old 06-08-2014, 11:59 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
^ +1 to that.

please keep in mind that measuring cpu usage is generally a pseudo-science and the outcome is only a rough approximation.
 
Old 06-08-2014, 12:11 PM   #4
rokytnji
LQ Veteran
 
Registered: Mar 2008
Location: Waaaaay out West Texas
Distribution: antiX 23, MX 23
Posts: 7,111
Blog Entries: 21

Rep: Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474Reputation: 3474
Mine is

Code:
harry@biker:~
$ inxi -f
CPU:       Single core Mobile Intel Pentium III - M (-UP-) cache: 512 KB
           clocked at 798 MHz
           CPU Flags: cmov cx8 de fpu fxsr mca mce mmx msr mtrr pae pge pse
           pse36 sep sse tsc vme
harry@biker:~
$ uname -r
3.14.3-dreamlinux-liquorix
Which is way way older so I just live with

Code:
${cpu}%
So as not to freak out over cpu usage.
 
Old 06-08-2014, 12:17 PM   #5
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
Quote:
Originally Posted by coralfang View Post
The ${cpu} value is showing the averaged use. If you look at the values in htop, there are two cores, conky is averaging that.

If you want to show each individual core, add to your conky something like this:
Code:
CPU0 ${cpu cpu0}% | CPU1 ${cpu cpu1}% |
which should show almost identical values as seen in htop.
I think that that CPU0 is actually the average and you would need to use CPU1 and CPU2 in conky to see the individual readings. Certainly that's how it works in my conky.
Code:
CPU0: ${freq_g 1}GHz: ${cpu cpu1}%${goto 320}CPU1:${freq_g 2}GHz: ${cpu cpu2}%${goto 640}CPU2:${freq_g 3}GHz: ${cpu cpu3}%${goto 980}CPU3:${freq_g 4}GHz: ${cpu cpu4}%
CPU4: ${freq_g 5}GHz: ${cpu cpu5}%${goto 320}CPU5:${freq_g 6}GHz: ${cpu cpu6}%${goto 640}CPU6:${freq_g 7}GHz: ${cpu cpu7}%${goto 980}CPU7:${freq_g 8}GHz: ${cpu cpu8}%
 
Old 06-08-2014, 05:37 PM   #6
robgeek
Member
 
Registered: Oct 2013
Posts: 37

Original Poster
Rep: Reputation: Disabled
Ok, guys!
I understand now.

Thank you for your answers!
 
Old 06-08-2014, 09:15 PM   #7
robgeek
Member
 
Registered: Oct 2013
Posts: 37

Original Poster
Rep: Reputation: Disabled
Guys. One more thing. If Conky shows me the average of usage, why when i'm compressing a file my system gets extremely slow and Conky shows me 50% or 60% of usage.
I know, probably i'm using for this task 100% of one core and nothing of the other one, but why my system gets so slow? Why he doesn't use the other core?
 
Old 06-09-2014, 04:47 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Because the Pentium 4 never had two cores, the only dual-core Pentiums from that era were the Pentium D CPUs.
What you have is a single core CPU with Hyperthreading, the CPU acts as having two virtual cores to be able to use its different units better. In the case of compressing files the CPU is already using all its parts to the limit so that a better utilization of other parts of the CPU is not possible, making your system slow while it appears to be working at only half its power.
 
1 members found this post helpful.
  


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
dipsplay cpu and memory usage using conky cccc Linux - Software 8 05-19-2018 09:19 AM
[SOLVED] big cpu usage, but top shows no heavy use process andrews-mark Linux - General 4 04-13-2012 12:22 AM
free, top and htop show different memory usage wulp Linux - General 2 07-13-2011 12:22 AM
/proc/<pid>/stat shows zero cpu usage simchac Linux - Kernel 0 07-25-2006 07:26 AM
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 - Software

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