Linux

使用 debian 8.1 和 Intel XEON E5-1650 v3 進行 CPU 頻率縮放

  • October 7, 2017

我希望我的伺服器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 優先考慮什麼 - 性能或節能 - 並讓它嘗試根據活動獲得最佳結果。它的位置要好得多。

引用自:https://serverfault.com/questions/709267