我希望我的服务器debian 8.1
不使用 CPU 缩放,但始终以尽可能高的频率运行。
我已经安装了 cpufrequtils
$ dpkg -l | grep cpufreq
ii cpufrequtils 008-1 amd64 ...
ii libcpufreq0 008-1 amd64 ...
我将州长设置performance
为
$ cat /etc/default/cpufrequtils
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0"
并打电话给/etc/init.d/cpurequtils restart
当我列出我的 cpu 信息时,cpufreq-info
我得到如下结果:
analyzing CPU 2:
driver: intel_pstate
CPUs which run at the same hardware frequency: 2
CPUs which need to have their frequency coordinated by software: 2
maximum transition latency: 0.97 ms.
hardware limits: 1.20 GHz - 3.80 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 1.20 GHz and 3.80 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 1.73 GHz (asserted by call to hardware).
最后一行显示cpu没有全速运行。当我检查 /sys 的值时,我得到相同的结果:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
echo "--"
cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
1198203
1199707
2001015
3048828
1551210
1358847
2953808
1982832
1523867
1200253
1654296
3446132
--
1198203
1199707
2001015
2643730
1772695
1358847
2953808
1982832
1523867
1200253
1654296
3446132
我想知道的是,我在 /sys 中没有任何名为“scaling_available_frequencies”的文件,这在许多howtos 中都提到过
ls -1 /sys/devices/system/cpu/cpu0/cpufreq/
affected_cpus
cpuinfo_cur_freq
cpuinfo_max_freq
cpuinfo_min_freq
cpuinfo_transition_latency
related_cpus
scaling_available_governors
scaling_cur_freq
scaling_driver
scaling_governor
scaling_max_freq
scaling_min_freq
scaling_setspeed
适当的内核模块都已加载:
$ lsmod | grep cpufre
cpufreq_powersave 12454 0
cpufreq_userspace 12525 0
cpufreq_conservative 14184 0
cpufreq_stats 12782 0
现在我像这样设置 scaling_min :
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
现在我得到类似看到的信息,它说频率应该在 3.80 GHz 和 3.80 GHz 之间,但实际上不是:
analyzing CPU 0:
driver: intel_pstate
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 0.97 ms.
hardware limits: 1.20 GHz - 3.80 GHz
available cpufreq governors: performance, powersave
current policy: frequency should be within 3.80 GHz and 3.80 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 2.84 GHz (asserted by call to hardware).
州长“表现”似乎没有做这项工作。那么如何强制我的 CPU 全速运行呢?
您必须检查您的 BIOS,因为 CPU P 状态似乎只能部分识别。如果在处理省电时发现许多服务器BIOS(主要是DELL)真的坏了。
因此,进入您的 BIOS 并禁用任何 CPU 节能功能。我建议您启用的唯一选项是关于 C 状态的选项(例如:C1E、C6/E、ecc。)。如果您的 BIOS 允许您选择电源配置文件,请选择“Max performance”。
3.8Ghz 听起来像是涡轮增压频率。您不能一直以这种速度运行所有内核 - CPU 不允许这样做(它会超出其功率预算)。您的 CPU 可能正在尽可能快地运行。
在较新的内核中,调控器只是告诉 CPU 优先考虑什么 - 性能或节能 - 并让它尝试根据活动获得最佳结果。它的位置要好得多。