Why is my Linode CPU Usage graph disagreeing with top?

The CPU usage of my 8GB Linode instance shows as hovering around 15-20% on the Linode panel.
<img alt="CPU graph" src="https://i.imgur.com/i72eFRG.png">

However, when I run top (or htop, etc.) I see that it reports, on average, less than 2% usage most of the time.

<img alt="top output" src="https://i.imgur.com/AAdP8Lg.png">

What's up with this discrepancy? Why does the panel show much higher CPU usage? Will this affect any kind of CPU limiting done on my system?

3 Replies

The Linode graphs are out of numvCPUs*100% (so in your case, 400%), whereas top is out of 100% (which explains about half the difference in itself). The Linode graphs look at the entire QEMU process that runs your Linode, rather than just the threads that correspond to the KVM vCPUs. Other QEMU threads handle various I/O operations and other tasks that consume CPU on the host (which shows up in Linode's graphs, but not in top/htop/etc within the Linode). Linode only controls CPU usage by limiting how many vCPUs are presented to your Linode, and not with other means like cgroups.

It can be caused by particular system calls which to your vm's eyes are cheap to run, but to the host are expensive because they aren't hardware accelerated.

Minecraft did cause 99% load on the host and 20% load on the vm due to a system call that was called in a tight loop.

I was just going to ask this same question. I started running Suricata (a network intrusion monitor) on my server and now Linode says that the CPU usage is like 185% (I'm running on a 2CPU instance so that's nearly full!) but top says I have like 15-20% load. That's QUITE a difference!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct