RHEL7.9设置CPU性能模式
在https://extensions.gnome.org/#上安装了Vitals这个可以实时监控处理器、内存、磁盘、网络、风扇、温度的这么一个插件。然后问题来了:
我的机子是华南金牌主板X58系列,处理器是至强X5690,监控显示处理器一直工作在3.47GHz,我还以为是Linux系统不完善造成的,后来一想,我装的红帽服务器的操作系统啊,于是查了下命令,看看能不能看到CPU运行参数什么的,强迫症不能忍。
命令为cpupower,在root用户下使用,或者普通用户加sudo。
Usage: cpupower [-d|--debug] [-c|--cpu cpulist ] <command> [<args>]
Supported commands are:
frequency-info
frequency-set
idle-info
idle-set
set
info
monitor
help
我这台式机CPU信息如下:
[root@master rhel]# cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us
hardware limits: 1.60 GHz - 3.47 GHz
available frequency steps: 3.47 GHz, 3.47 GHz, 3.33 GHz, 3.20 GHz, 3.07 GHz, 2.93 GHz, 2.80 GHz, 2.67 GHz, 2.53 GHz, 2.40 GHz, 2.27 GHz, 2.13 GHz, 2.00 GHz, 1.87 GHz, 1.73 GHz, 1.60 GHz
available cpufreq governors: conservative userspace powersave ondemand performance
current policy: frequency should be within 1.60 GHz and 3.47 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency: 3.47 GHz (asserted by call to hardware)
boost state support:
Supported: yes
Active: yes
2700 MHz max turbo 4 active cores
2700 MHz max turbo 3 active cores
2800 MHz max turbo 2 active cores
2800 MHz max turbo 1 active cores
重新设置CPU性能模式,这个是可以立即生效的。
[root@master rhel]# cpupower frequency-set -g ondemand
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
Setting cpu: 3
Setting cpu: 4
Setting cpu: 5
Setting cpu: 6
Setting cpu: 7
Setting cpu: 8
Setting cpu: 9
Setting cpu: 10
Setting cpu: 11
再次查看有如下信息:
current policy: frequency should be within 1.60 GHz and 3.47 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency: 1.73 GHz (asserted by call to hardware)
OK,搞定。