cpufreq
用来控制 CPU 的频率,工具为 cpufrequtils
安装
apt-get install cpufrequtils
相关bin:
- /usr/bin/cpufreq-aperf
- /usr/bin/cpufreq-info
- /usr/bin/cpufreq-set
使用
查看 CPU 频率
cpufreq-info
# 或
cat /proc/cpuinfo
更改 CPU 频率控制策略
$ cpufreq-set --help
cpufrequtils 008: cpufreq-set (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
Usage: cpufreq-set [options]
Options:
-c CPU, --cpu CPU number of CPU where cpufreq settings shall be modified
-d FREQ, --min FREQ new minimum CPU frequency the governor may select
-u FREQ, --max FREQ new maximum CPU frequency the governor may select
-g GOV, --governor GOV new cpufreq governor
-f FREQ, --freq FREQ specific frequency to be set. Requires userspace
governor to be available and loaded
-r, --related Switches all hardware-related CPUs
-h, --help Prints out this screen
Notes:
1. Omitting the -c or --cpu argument is equivalent to setting it to zero
2. The -f FREQ, --freq FREQ parameter cannot be combined with any other parameter
except the -c CPU, --cpu CPU parameter
3. FREQuencies can be passed in Hz, kHz (default), MHz, GHz, or THz
by postfixing the value with the wanted unit name, without any space
(FREQuency in kHz =^ Hz * 0.001 =^ MHz * 1000 =^ GHz * 1000000).
说明:
-f
指定常用的策略,包括:
powersave
省电模式
userspace
自定义频率模式
ondemand
默认模式,当有cpu计算量的任务,会立即达到最大频率运行,完成后立即回到最低频率
conservative
保守模式
performance
效率模式
使用
sudo cpufreq-set -g powersave
sudo cpufreq-set -d 频率下限
sudo cpufreq-set -u 频率上限
sudo add-apt-repository ppa:artfwo/ppa
sudo apt-get update
sudo apt-get install indicator-cpufreq