简介
本文档介绍如何为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
如果goner设置为除性能以外的任何值,请进一步遵循本指南。
解决方案
要使CPU以最大频率运行,需要将CPU调节器设置为性能模式。要执行此操作,请运行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
相关信息