linux下关闭服务器的CPU(睿频)自动降频
因为在负载低的时候,CPU工作在较低的频率,为了节能,但在服务器突发访问时,CPU不断在高低频率上切换,所以需要关闭自动降频。
root@cache:~# grep -E '^model name|^cpu MHz' /proc/cpuinfo model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 3101.000 model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 1600.000 model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 3101.000 model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 1600.000 root@cache:~# for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do [ -f $CPUFREQ ] || continue; echo -n performance > $CPUFREQ; done root@cache:~# grep -E '^model name|^cpu MHz' /proc/cpuinfo model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 3101.000 model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 3101.000 model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 3101.000 model name : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz cpu MHz : 3101.000
永久关闭:
If you are running 'cpuspeed', 'cpufreqd', 'powerd' or other daemons, that can control CPU stepping, just stop them, if you really need to run your system on 100% of the CPU speed.
On CentOS:
On CentOS:
On Linux 2.6.32 (On RedHat 6, and Oracle Unbreakable Linux 6) remove CPU scaling kernel modules: