Through “Scaling Governor”, you can choose the optimal CPU frequency control scheme, which affects power consumption and performance.
On highly loaded access servers, acquaintances had cases of server hangup during “ondemand”, although I did not have such cases, but still I recommend changing it to “performance”.
On laptops and lightly loaded servers, you can leave “ondemand” to save energy.
Let’s see the current value of all processor cores:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor ls /sys/devices/system/cpu/
In my case, the default value for all eight cores is “ondemand”.
Let’s look at possible schemes:
Switch to root user:
And we indicate for all kernels “performance”:
echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor echo performance > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor
apt install cpufrequtils for i in 0 1 2 3 4 5 6 7 8 9 10 11; do cpufreq-set -c $i -g performance; done
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor egrep '(MHz)' /proc/cpuinfo
If the previous methods did not help, then for the Intel CPU, you can also specify “intel_idle.max_cstate” in the grub:
nano /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1 ..." update-grub reboot dmesg -T | grep intel_idle
See also my article:
Changing the processor core frequency in Linux