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

chchia

New Member
Aug 18, 2020
17
5
3
44
I notice that, even if I set all my CPU governor to powersaving with default intel_pstate drive, still the CPU gets up to maximum frequency as soon as VM started even it is almost idle in VM. CPU report in host show CPU boost up to 4Ghz for all cores. CPU temperature reported at about 50c.

So I replaced the intel_pstate with acpi-cpufreq drive.

since i am using homelab, I will say this is a great improvement, lower CPU voltage, lower temperature. yet not much noticeable performance impact. unless you care about benchmark result.
1613381780818.png


how to do:

1. follow this guide and reboot the host
https://silvae86.github.io/2020/06/13/switching-to-acpi-power/

in summary:
Code:
apt-get update
apt-get install acpi-support acpid acpi

#edit /etc/default/grub and add intel_pstate=disable to GRUB_CMDLINE_LINUX_DEFAULT
GRUB_CMDLINE_LINUX_DEFAULT="intel_pstate=disable"

update-grub

reboot

2. change you proxmox host CPU governor

Code:
#this command set all CPU to conservative mode, most of the CPU available governor mode using acpi will be:
# conservative ondemand userspace powersave performance schedutil
#You can contrab -e and put below command with @reboot
echo "conservative" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor


you can use i7z or cpupower to monitor your temperature. hope this help if you also have high cpu frequency lock issues with promox.


also to mention that, this fix the CU usage report issues for me too, previously in proxmox gui it will report windows 10 VM is using 15% ~ 20% of CPU while the VM is idle, now the gate is much smaller and i hope it is more accurate now. (OS Type: Other)
1613383524992.png
 
Last edited:

masgo

Member
Jun 24, 2019
45
3
13
72
I am not sure if the "replace the intel-pstate CPU power management driver with the acpi-cpufreq one" part is still valid for recent CPUs. What I have done is simply set the powersave state and let the CPU do the rest.

Code:
echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

If you are happy with this, you can add it to crontab with
Code:
@reboot echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

You can use cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors to see which governors are available.
 
  • Like
Reactions: James Crook

H4R0

Active Member
Apr 5, 2020
616
130
43
I am not sure if the "replace the intel-pstate CPU power management driver with the acpi-cpufreq one" part is still valid for recent CPUs. What I have done is simply set the powersave state and let the CPU do the rest.

Code:
echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

If you are happy with this, you can add it to crontab with
Code:
@reboot echo "powersave" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

You can use cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors to see which governors are available.

That's the same I do, but using the configuration file is a bit nicer.

Code:
## cpu scaling
# proxmox uses performance by default change to powersave to enable cpu scaling
# cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
apt install cpufrequtils

cat << 'EOF' > /etc/default/cpufrequtils
GOVERNOR="powersave"
EOF
 
  • Like
Reactions: masgo

chchia

New Member
Aug 18, 2020
17
5
3
44
well, i tried pstate with powersave, at it still try to kick my CPU to highest frequency and making my CPU 10c higher than ACPI conservative, even though my VM is not doing anything extensive.

1614759159493.png
 

masgo

Member
Jun 24, 2019
45
3
13
72
well, i tried pstate with powersave, at it still try to kick my CPU to highest frequency and making my CPU 10c higher than ACPI conservative, even though my VM is not doing anything extensive.

View attachment 24101
The % display of CPU load might be wrong when the CPU is scaling its frequency down. When running on anything other than "performance" you should look at the temperature and power-consumption (~ voltage). I use netdata for this, but you can choose any tool since netdata might be a litte overkill.
 

chchia

New Member
Aug 18, 2020
17
5
3
44
yeap, i am using i7z to monitor cpu frequency and temperature, and using acpi is significanly lower frequency and temperature yet performance is similar.

1614762648642.png
 

NikoC

New Member
Feb 22, 2021
14
0
1
20
Any luck for AMD? I'm having awful single core perf on a 5950x system.
 

masgo

Member
Jun 24, 2019
45
3
13
72
Any luck for AMD? I'm having awful single core perf on a 5950x system.
Sorry, I have no AMD servers with Proxmox/Linux right now. But PVE is based on Ubuntu. Most things that work for ubuntu also work for PVE. Do a search for amd power-management in ubuntu or amd cpu scaling in ubuntu or amd battery life ubuntu. Usually you will find something where people talk about notebooks and battery optimization, but most of it is true for servers as well.

If your results are to old, limit the search to "last year", since Ryzen 9 series is rather new.
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
4,858
1,320
164
South Tyrol/Italy
shop.proxmox.com
Slight correction, we base off Debian, not Ubuntu (which is also a derivate of Debian), but yes, we base off the Ubuntu flavoured Linux kernel.

And further I believe that NikoC actually wants the opposite of this thread, i.e., always full frequency (as performance not power usage was noted as to small).
 
  • Like
Reactions: masgo

mcdull

Member
Aug 23, 2020
54
2
8
43
Any news about the new AMD p-state kernel driver that we can test?
We have got pretty bad performance per watt on AMD platform.
 

t.lamprecht

Proxmox Staff Member
Staff member
Jul 28, 2015
4,858
1,320
164
South Tyrol/Italy
shop.proxmox.com
Any news about the new AMD p-state kernel driver that we can test?

The amd-pstate driver is not yet accepted in any kernel git tree, and still under review, the last revision was posted only a few days ago FWICT: https://lore.kernel.org/lkml/20210926090605.3556134-1-ray.huang@amd.com/

We do not patch in driver that are still under development and as it seems from comments, seem to require still some change before being ready to go into the kernel.. If you want you can just build a kernel with those patches applied yourself though.
The earliest I see this getting released is v5.16, if they get it in shape for the next merge window that should start in the first half of November and then be released in a kernel version in the start of 2022, it may find its way into PVE then, but when and how cannot be told for sure yet.
We have got pretty bad performance per watt on AMD platform.
There are many AMD platforms, which one do you mean and how do you determine that? As we have various EPYC, Threadripper and Ryzen platforms in use here in servers and workstations and do not see significant issues, but we use the default performance CPU scheduling governor, and that wouldn't see much difference for the p-state changes anyway.
 

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!