[TUTORIAL] Fix always high CPU frequency in proxmox host.

Neobin

Renowned Member
Apr 29, 2021
882
300
63
Wrong, just edit the /etc/default/cpufrequtils and change to GOVERNOR="schedutil"

I do not have a /etc/default/cpufrequtils file; what could be the reason? Oh wait; I have to install the additional package cpufrequtils first. ;)

What is the advantage of using cpufrequtils, instead of a simple small cronjob, if someone only wants to change the used governor?

And why makes one possible option another possible option "wrong"? Are multiple possible options not allowed?
 
  • Like
Reactions: Joysaab and keeka

janssensm

Well-Known Member
Dec 18, 2016
234
81
48
There's no need to install a package or cronjob.
Package cpufrequtils can still be installed and is maintained.
But yet for how long? Debian wiki states it will be replaced by cpupower [0].

Since 5.9 there's a kernel command line parameter to set the default cpufreq governor [1].
Checked in the current pve kernel 5.15.x and the parameter is there [2].
This is much better in my opinion as you can see this parameter in your logs every boot.
You can just check with cpupower frequency-info, or via sysfs of course.

Set it and be sure to run proxmox-boot-tool refresh.


[0] https://wiki.debian.org/CpuFrequencyScaling (last edited 2019)
[1] https://kernelnewbies.org/Linux_5.9#CPU_Frequency_scaling
[2] https://www.kernel.org/doc/html/v5.15/admin-guide/kernel-parameters.html
 
Last edited:
  • Like
Reactions: Neobin and keeka

keeka

Member
Dec 8, 2019
71
9
13
There's no need to install a package or cronjob.
Package cpufrequtils can still be installed and is maintained.
But yet for how long? Debian wiki states it will be replaced by cpupower [0].

Since 5.9 there's a kernel command line parameter to set the default cpufreq governor [1].
Checked in the current pve kernel 5.15.x and the parameter is there [2].
This is much better in my opinion as you can see this parameter in your logs every boot.
You can just check with cpupower frequency-info, or via sysfs of course.

Set it and be sure to run proxmox-boot-tool refresh.


[0] https://wiki.debian.org/CpuFrequencyScaling (last edited 2019)
[1] https://kernelnewbies.org/Linux_5.9#CPU_Frequency_scaling
[2] https://www.kernel.org/doc/html/v5.15/admin-guide/kernel-parameters.html
Thanks for this.
When I update kernel commandline, I usually run update-grub directly and don't use proxmox-boot-tool
Having just tried proxmox-boot-tool refresh, I notice no modifications are made to /boot/grub/grub.cfg and therefore new boot args won't be applied.
 

janssensm

Well-Known Member
Dec 18, 2016
234
81
48
Hi, then you are probably running legacy boot, without proxmox-boot-tool.
Fresh pve installs will now use proxmox-boot-tool automatically.
You may want to consider migrating to proxmox-boot-tool if you are running your system with root on zfs.
fe, from the admin doc:
A system with root on ZFS, that still boots using grub will become unbootable if a new feature is active on the rpool, due to the incompatible implementation of ZFS in grub.
See [0] and [1]
You can run proxmox-boot-tool status to see current status, but if you have upgraded an older system (pre pve 6.4) and not migrated manually then you probably are running legacy boot.
If you do plan to migrate, read the docs carefully first, and perhaps test the migration steps in a (nested) pve vm.

EDIT: if more discussion on the proxmox-boot-tool is needed, we should move that to a separate thread.

[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysboot
[1] https://pve.proxmox.com/wiki/ZFS:_Switch_Legacy-Boot_to_Proxmox_Boot_Tool
 
Last edited:

keeka

Member
Dec 8, 2019
71
9
13
Hi, then you are probably running legacy boot, without proxmox-boot-tool.
Fresh pve installs will now use proxmox-boot-tool automatically.
You may want to consider migrating to proxmox-boot-tool if you are running your system with root on zfs.
fe, from the admin doc:

See [0] and [1]
You can run proxmox-boot-tool status to see current status, but if you have upgraded an older system (pre pve 6.4) and not migrated manually then you probably are running legacy boot.
If you do plan to migrate, read the docs carefully first, and perhaps test the migration steps in a (nested) pve vm.

EDIT: if more discussion on the proxmox-boot-tool is needed, we should move that to a separate thread.

[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#sysboot
[1] https://pve.proxmox.com/wiki/ZFS:_Switch_Legacy-Boot_to_Proxmox_Boot_Tool

You're correct, this is an in place upgrade. I don't use ZFS. Thanks for the references.
 
  • Like
Reactions: janssensm

gbschenkel

New Member
There's no need to install a package or cronjob.
Package cpufrequtils can still be installed and is maintained.
But yet for how long? Debian wiki states it will be replaced by cpupower [0].

Since 5.9 there's a kernel command line parameter to set the default cpufreq governor [1].
Checked in the current pve kernel 5.15.x and the parameter is there [2].
This is much better in my opinion as you can see this parameter in your logs every boot.
You can just check with cpupower frequency-info, or via sysfs of course.

Set it and be sure to run proxmox-boot-tool refresh.


[0] https://wiki.debian.org/CpuFrequencyScaling (last edited 2019)
[1] https://kernelnewbies.org/Linux_5.9#CPU_Frequency_scaling
[2] https://www.kernel.org/doc/html/v5.15/admin-guide/kernel-parameters.html
As stated, cpupower will be replaced, but cpufrequtils is the default right now on Proxmox, and come preinstalled with 7.2(at least), not needing install anything, that why I said `wrong` to @Neobin.
 

Neobin

Renowned Member
Apr 29, 2021
882
300
63
cpufrequtils is the default right now on Proxmox, and come preinstalled with 7.2(at least), not needing install anything, that why I said `wrong` to @Neobin.

My fresh installation with the official 7.2-ISO from the official Proxmox site does not have cpufrequtils pre-installed!
Maybe I downloaded the wrong 7.2-ISO? Or maybe I installed PVE the wrong way? ;)

Anyway, fortunately everyone can do it however they want. :cool:
 
  • Like
Reactions: janssensm

gbschenkel

New Member
My fresh installation with the official 7.2-ISO from the official Proxmox site does not have cpufrequtils pre-installed!
Maybe I downloaded the wrong 7.2-ISO? Or maybe I installed PVE the wrong way? ;)

Anyway, fortunately everyone can do it however they want. :cool:
My bad, I misplaced the dns name from my new installed proxmox server v7.2 when doing ssh, with the old one, to check the package installed.
 

janssensm

Well-Known Member
Dec 18, 2016
234
81
48
Since frequency scaling can cause all sorts of behaviour
I was troubleshooting and saw a significant increase in cpu usage in all monitoring tools running, in all vm's and on the host. But that seems to be expected as the host will run on a lower frequency a lot of the time, which it would not if running performance governor.
So I was a bit misled by the monitoring stats, could not find another system change than selecting schedutil as governor. And you could argue that for monitoring your system, schedutil will not make troubleshooting easier ;)

edit: and to confirm, after changing governor to performance, monitoring stats were back like before schedutil change.
 
Last edited:
  • Like
Reactions: gbschenkel

tauceti

New Member
May 11, 2021
22
5
3
40
is the amd_pstate driver now working? Or when will it be integrated? In kernel 15.17?
I tried to test it with current proxmox and kernel 5.15 and enabling it via
modprobe amd_pstate
but it didn't work and I couldn't remove the acpi-cpufreq module via modprobe -r as it is builtin...

I just want to test it. Is it possible?
Currently I use onDemand governor with acpi-cpufreq driver.
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
5,506
1,756
164
South Tyrol/Italy
shop.proxmox.com

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!