[Solved] Idle CPU usage (x64 platform)

I created an x64 OpenWrt image with the image builder and imported it into vSphere. It's running great and doing everything I want it to do, however there is one small thing that's triggering my OCD.

The virtual machine is consuming 24Mhz of CPU, whereas a Debian install that's doing nothing is managing to use 0MHz. Yes, I agree this is no big deal, but it would still be nice to understand it. Both Debian and OpenWrt are using the vmtoolsd (but I have tried stopping it on OpenWrt). In fact I have stopped all services on OpenWrt to see if any of them are taking CPU, but that made no difference. I guess something in the kernel is preventing a sleep mode.

Has anyone come across this before? Thanks!

EDIT: I've found some non-OpenWrt VMs with similar behaviour don't think it relates to OpenWrt.

what does cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor say ?

2 Likes

The cpufreq directory is not there, so I guess I'm missing the relevant kernel module, and from a quick google seems to be something like modprobe cpufreq_userspace? I don't seem to have that module so I guess it's optional and I need to find the package. I couldn't find this package with a brief search (not that I looked very hard, however).

Thanks for the hint frollic.

I don't have any openwrt device on the x86_64 platform, but there's no module containing
the string cpu on my router.

This might point you in the right direction https://forum.archive.openwrt.org/viewtopic.php?id=57536

1 Like

Would you really want a router to enter a sleep state? I'd imagine that would have an impact on routing latency

2 Likes

On my x86_64 (not running openwrt) there are several modes/options

[root@atlantis ~]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
conservative ondemand userspace powersave performance schedutil
[root@atlantis ~]#

Whatever it does, I'm perfectly happy for it to do the same as the Debian box it's replacing (but with much lower disk and memory footprint), so although it may not be ideal I'm still winning.

That's curious. I run a x86_64 build and it's there. It's a custom build, but I don't recall having had to do anything specific to enable the cpufreq driver.

If the symbol CONFIG_CPU_FREQ is set in the kernel, then this proc node should appear given that the /proc pseudo file system is enabled.

Looking at target/linux/x86/config-5.4, CONFIG_CPU_FREQ is enabled in the default kernel configuration for x86 and x86_64 builds....

1 Like

To be clear...you're concerned that a running machine is using 24 MHz of CPUs???

Ummmm yes, every time I run a VM.

1 Like

You appear to have not read my post, picked out a few choice bits and used that as the basis to have a go. I clearly stated "Yes, I agree this is no big deal, but it would still be nice to understand it." and I also drew the distinction between Debian and OpenWrt.

I suspect the file is not there and governor selection is not available because you're running in a virtual machine.

1 Like

I read it in its entirety.

Understand what, normal behavior?

EDIT: It seems the OP figured out I was simply verifying there was some concern from them about normal VM behavior:

1 Like

I found your post somewhat patronising. I saw a good dozen instances of OpenWrt which were reporting CPU usage, and a good dozen or so Debian instances which weren't. Reporting error? Maybe. What conclusion would you draw if you didn't know better? So I didn't see any reason for you to respond in this way, it would have been enough to simply report your experiences.

I did, you called it crap.

I hope your research works out; and I apologize you found my post patronizing.

  • VM Tools installed?
  • USB installed?
  • Theoretically, a running machine cannot be running 0.
1 Like

Just to be clear, the only part of your post I considered 'crap' was this bit:

Were it not for that, I would have welcomed the input.

No he is concerned that a running machine with OpenWrt is using 24 Mhz while a running machine with Debian is using 0 Mhz and wanted to know more about this discrepancy.
This is clearly stated in the second sentence in OP.

Thanks bobafet for that, however I think this thread has run its course, and it doesn't really help anyone too much in terms of information content, for the record I am happy if the admins want to delete the entire topic, although I realise that may annoy the people who've contributed. Thanks for all the replies from people trying to help (I include Ileachii in that list).

EDIT: One thing to note, is that the CPU usage in vSphere can be misleading. For instance, I have one OpenWrt VM showing summary as:
image

But the realtime graph is showing non-zero values:

image

You'll see that same summary when viewing lists of machines. It seems the summary value can appear very consistent across sets of VMs with similar usage patterns. Will be interesting to compare with what Proxmox says.

I'm just keeping him straight, it's not the first time he "misreads" posts like that.

1 Like

I understood that, your rewording didn't change that, I answered according to your wording too. I really don't get why Debian...OpenWrt...I read it was 24 MHz. You can pretend like I didn't provide a suggestion too...to ANY RUNNING VM SHOWING 24 MHz.

Really acting like people can't read, I thought better of you.

I am capable of saying I didn't read (as I have before). And this is at least the 2nd time I said I did. So who can't read?

You keep people straight with truth, not lies, good sir.

There are people who grew up in my society (at least) - where you put them down by saying they cannot read (and other hurling of ignorant rants toward them). It's wrong.

1 Like

I think I can summarise it as:

Me: Yes, I agree this is no big deal, but it would still be nice to understand it.
You: To be clear...you're concerned that a running machine is using 24 MHz of CPUs???

So it's me agreeing it's no big deal, vs me being concerned. They seem like positions which are quite far apart. So that's why two people on the topic got the conclusion that you hadn't read the post.

But I do appreciate the apology (I'm not familiar with any of your other posts so can't comment), so I've no problem with you here.