Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Why do the progress meters across the top of the screen in htop show CPU usage consistently above >90% while the numbers in the table below show a nearly idle system with CPU usage and load average at 0.0%?

partial htop screen grab

share|improve this question
    
I have the exact same issue and I am also on a Dreamhost VPS (virtual private server). –  duality_ Jan 30 '13 at 22:22
    
@duality_, thanks for the confirmation. –  matt wilkie Jan 31 '13 at 17:05
    
BTW, look at my example, it's even worse: demo.ddesign.si/temp/dh3.png –  duality_ Jan 31 '13 at 22:06
add comment

3 Answers

up vote 1 down vote accepted

htop is unaware it is running on a kernel level virtualized environment. It is then showing the CPU usage for all the OS instances sharing the same kernel, not just yours.

The regular top might not present this issue. Have a look to vtop output too.

share|improve this answer
    
+1 for the explanation; top reports similarly to htop on this machine. Vtop not tested as not installed. Marking this as accepted because it answers "why?", though it doesn't address the implicit "and what can be done about it?", as that was unspoken –  matt wilkie Mar 22 '13 at 17:49
add comment

This sort of inconsistency is usually indicative of high processor usage by kernel threads, which aren't displayed in htop by default. To display them, in htop go to Setup, then Display options, and then uncheck Hide kernel threads. This should allow you to see the thread(s) that are responsible.

You can also disable this behaviour by setting hide_kernel_threads to 0 in ~/.htoprc.

share|improve this answer
1  
thanks Chris. I did that but the table values are still 0%. Maybe this is something peculiar to running in a virtual machine? The host is Virtual Private Server (on Dreamhost.com). –  matt wilkie Feb 17 '12 at 21:37
add comment

Try launching htop with sudo. You need root access to see those active threads in the table.

share|improve this answer
    
I don't know how well or not this works on regular virtualized environments, if there is such a thing as regular, but doesn't work on dreamhost VPS. –  matt wilkie Mar 22 '13 at 17:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.