簡介
本文檔介紹如何為SAP HANA資料庫配置CPU調控器以獲得最佳效能,並驗證是否使用了正確的CPU調控器。
背景資訊
CPU調控器設定為效能模式將使CPU以最大頻率運行,即使系統處於空閒狀態也是如此。本文檔適用於在SuSE Linux或Red Hat Enterprise Linux(RHEL)上運行的SAP HANA資料庫。
必要條件
需求
思科建議您瞭解以下主題:
採用元件
本文件所述內容不限於特定軟體和硬體版本。
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路正在作用,請確保您已瞭解任何指令可能造成的影響。
問題
若要檢查當前的CPU調控器,請運行cpupower frequency-info 命令
server01a:~ # cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7 8 9 40 41 42 43 44 45 46 47 48 49
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.06 GHz - 2.40 GHz
available frequency steps: 2.40 GHz, 2.39 GHz, 2.26 GHz, 2.13 GHz, 2.00 GHz, 1.86 GHz, 1.73 GHz, 1.60 GHz, 1.46 GHz, 1.33 GHz, 1.20 GHz, 1.06 GHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance
current policy: frequency should be within 1.06 GHz and 2.40 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 1.06 GHz (asserted by call to hardware).
boost state support:
Supported: yes
Active: yes
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
如果governor設定為performance以外的任何設定,請進一步遵循本指南。
解決方案
為了使CPU以最大頻率運行,需要將CPU調控器設定為performance模式。為此,請運行cpupower frequency-set -g performance 命令。
server01a:~ # /usr/bin/cpupower frequency-set -g performance
Setting cpu: 0
Setting cpu: 1
Setting cpu: 2
<output ommited for brevity>
要確保配置在主機重新啟動後仍然存在,請將此命令新增到啟動指令碼中。
如果使用SuSE Linux,請鍵入此命令。
server01a:~ # echo '/usr/bin/cpupower frequency-set -g performance' >> /etc/init.d/after.local
如果使用Red Hat Enterprise Linux,請鍵入此命令。
server01a:~ # echo '/usr/bin/cpupower frequency-set -g performance' >> /etc/rc.d/rc.local
驗證
運行cpufreq-info frequency-info命令以確保使用效能調控器。
server01a:~ # cpupower frequency-info
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3 4 5 6 7 8 9 40 41 42 43 44 45 46 47 48 49
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 10.0 us.
hardware limits: 1.06 GHz - 2.40 GHz
available frequency steps: 2.40 GHz, 2.39 GHz, 2.26 GHz, 2.13 GHz, 2.00 GHz, 1.86 GHz, 1.73 GHz, 1.60 GHz, 1.46 GHz, 1.33 GHz, 1.20 GHz, 1.06 GHz
available cpufreq governors: conservative, userspace, powersave, ondemand, performance
current policy: frequency should be within 1.06 GHz and 2.40 GHz.
The governor "performance" may decide which speed to use
within this range.
current CPU frequency is 2.39 GHz (asserted by call to hardware).
boost state support:
Supported: yes
Active: yes
25500 MHz max turbo 4 active cores
25500 MHz max turbo 3 active cores
25500 MHz max turbo 2 active cores
25500 MHz max turbo 1 active cores
相關資訊