Check which CPU mode is in use

Prerequisites System: Linux (Debian, Ubuntu, Proxmox, etc.)

Privileges: root

CPU: supports dynamic frequency scaling (Intel Xeon, AMD EPYC / Ryzen, etc.)

governor

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

  • powersave: low-power mode (locked low frequency, power-saving but weak)
  • ondemand: on-demand boost (only boosts when needed, may respond a bit slowly)
  • performance: full performance (this is what we want)

Check which driver the kernel uses (Intel / AMD)

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver

Temporarily max out performance

for cpu in /sys/devices/system/cpu/cpu[0-9]*; do
  echo performance > $cpu/cpufreq/scaling_governor
done

Keep performance after reboot

Option A: most stable recommendation

apt install cpufrequtils -y

echo 'GOVERNOR="performance"' >/etc/default/cpufrequtils
systemctl enable cpufrequtils
systemctl start cpufrequtils

Option B: custom systemd service

# /etc/systemd/system/cpu-performance.service
[Unit]
Description=Set CPU governor to performance
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c 'for cpu in /sys/devices/system/cpu/cpu[0-9]*; do echo performance > $cpu/cpufreq/scaling_governor; done'

[Install]
WantedBy=multi-user.target
systemctl daemon-reexec
systemctl daemon-reload
systemctl enable --now cpu-performance.service