Tools & Add-onsPVE Tools
PVE CPU Scaling Governor
Show and change the CPU frequency scaling governor of the host and optionally keep the choice across reboots.
The scaling governor decides how the kernel picks the CPU frequency, for example performance for the highest frequency or powersave to save energy. scaling-governor.sh shows the current governor, lets you pick another one and can add a cron entry that sets it again after every boot.
Website entry: scaling-governor. Source: tools/pve/scaling-governor.sh.
Run
In the Proxmox VE host shell, as root:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/pve/scaling-governor.sh)"Prompts
| Dialog | Choices | Effect |
|---|---|---|
| "View/Change CPU Scaling Governors. Proceed?" | Yes / No | No exits. |
"CPU Scaling Not Available" (only if /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor or scaling_available_governors cannot be read) | OK | The script exits. This is normal when no cpufreq driver is active. |
| "Select the Scaling Governor to use:" (radio list; the title shows the current governor) | The governors from scaling_available_governors, without the current one | The selection is written to /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor, that is to all cores. Selecting nothing exits without changes. |
| "Setup a crontab?" | yes | Adds the @reboot entry below to root's crontab. |
no | The governor stays until the next reboot. |
Which governors are offered depends on the CPU driver. The script only shows what the kernel reports.
Cron entry
@reboot (sleep 60 && echo "<governor>" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor)Before adding it, the script removes an existing line that contains @reboot (sleep 60 && echo, so there is only ever one such entry.
Undo
- Run the script again and select the previous governor.
- Remove the persistence with
crontab -eand delete the@reboot (sleep 60 && echo ...line.
Environment variables
| Variable | Default | Purpose |
|---|---|---|
COMMUNITY_SCRIPTS_CORE_URL | https://raw.githubusercontent.com/community-scripts/core/main | Base URL the script loads api/api.func from. |
Limits
- With the cron entry the governor is applied 60 seconds after boot, not immediately.
- Choosing
noat the crontab question does not remove an entry from an earlier run. - The list is read from
cpu0. The script assumes all cores offer the same governors.