在一些独立服务器上,CPU 会默认设置成节能模式,如果要发挥性能,需要把 CPU 设置成性能模式:
#设置性能模式
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
[ -f $CPUFREQ ] || continue
echo -n performance > $CPUFREQ
done
#查看效果
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor