使用 debian 8.1 和 Intel XEON E5-1650 v3 进行 cpu频率缩放

使用 debian 8.1 和 Intel XEON E5-1650 v3 进行 cpu频率缩放

我希望我的服务器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”的文件,而许多指南中都提到过

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

现在我得到了类似 sees 的信息,上面写着频率应在 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 全速运行?

答案1

您必须检查您的 BIOS,因为 CPU P 状态似乎仅被部分识别。如果发现许多服务器 BIOS(主要是 DELL)在处理省电时确实有问题。

因此,请进入 BIOS 并禁用所有 CPU 节能功能。我建议您保留启用的唯一功能是有关 C 状态的功能(例如:C1E、C6/E 等)。如果您的 BIOS 允许您选择电源配置文件,请选择“最大性能”。

答案2

3.8Ghz 听起来像是一个涡轮增压频率。您无法一直以该速度运行所有核心 - CPU 不允许这样做(这会超出其功率预算)。您的 CPU 可能已经以最高速度运行。

在较新的内核中,调节器只会告诉 CPU 优先考虑什么 - 性能还是节能 - 并让它根据活动尝试获得最佳结果。它在这方面处于更有利的位置。

相关内容