Re:CPU Utilization is Wrong
by brendangregg on Tuesday May 09, 2017 @06:15PM
(#14304291)
Screenshot? My version of htop does not show stalls. The only top I've seen that uses PMCs is tiptop.
htop should add PMC support, and a lot more things too. I might even start using it then. :)
It's steal, not stall - time "stolen" by the hypervisor, i.e. when you have runnable threads but the CPU is busy servicing other VMs. This can lead to stalling of your software, I guess, but it has nothing to do with instruction stalls.
htop, at least in the version I'm using, only shows steal if it's non-zero.
steam time is available from mpstat. It's a machine-scoped metric so it should not belong to top which is process-scoped.
Enabling it allows you to see a clearer picture of not just stalls but also CPU steal from "noisy neighbors" -- guests also assigned to the same host.
I've seen CPU steal cause kernel warnings of "soft-lockups". I've also seen zombie processes occur. I suspect they're related but it's only anecdotal: I'm not sure how to investigate.
It's pretty amazing what kind of patterns you can identify when you've got stuff like that running. Machine seems to be non-responsive? Open up htop, see lots of grey... okay so since all data is on the network, that means that it's a data bottleneck; over the network means it could be bottlenecked at network bandwidth or the back-end SAN could be bottlenecked.
Fun fact: Windows Server doesn't like not having its disk IO not be serviced for minutes at a time. That's not a fun way to have another team come over and get angry because you're bluescreening their production boxes.