Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

第 4 章 tuned 和 tuned-adm

本章论述了使用 tuned 守护进程来调优虚拟环境中的系统设置。
Tuned 是一个调优的配置文件 交付机制,可针对某些工作负载特性调整 Red Hat Enterprise Linux,如 CPU 密集型任务的要求,或者存储/网络吞吐量响应。它提供了一些预配置调优配置文件,以增强性能并减少在很多特定用例中的能耗。编辑这些配置集或创建新配置集以创建根据您的环境定制的性能解决方案。
作为 tuned 的一部分提供的虚拟化相关配置集包括:
virtual-guest
基于 throughput-performance 配置集,virtual-guest 也会降低虚拟内存的交换性。
创建 Red Hat Enterprise Linux 7 客户机虚拟机时会自动选择 virtual-guest 配置集。它是虚拟机的建议配置集。
此配置集在红帽企业 Linux 6.3 及更新的版本中提供,但必须在安装虚拟机时手动选择。
virtual-host
基于 throughput-performance 配置集,virtual-host 还可提高脏页面的主动回写。这个配置集是虚拟化主机的推荐配置集,包括 KVM 和 Red Hat Virtualization(RHV)主机。
在 Red Hat Enterprise Linux 7 安装中,默认安装 tuned 软件包并启用 tuned 服务。
要列出所有可用配置集并确定当前活跃的配置集,请运行:
# tuned-adm list
Available profiles:
- balanced
- desktop
- latency-performance
- network-latency
- network-throughput
- powersave
- sap
- throughput-performance
- virtual-guest
- virtual-host
Current active profile: throughput-performance
也可以创建 自定义调优配置集 来封装一组调优参数。有关创建 自定义调优配置集 的说明,请参阅 tuned.conf man page。
要只显示当前活跃的配置集,请运行:
tuned-adm active
要切换到其中一个可用配置集,请运行:
tuned-adm profile profile_name
例如,要切换到 virtual-host 配置集,请运行:
tuned-adm profile virtual-host
重要
在 Red Hat Enterprise Linux 7.1 及更高版本中设置调优配置集后,确保为重启后要应用配置的配置集启用 tuned 服务:
# systemctl enable tuned
在某些情况下,最好禁用 tuned 来使用手动设置的参数。要禁用当前会话的所有调整,请运行:
# tuned-adm off
要永久禁用 tuned 并恢复它执行的所有更改,请运行:
# tuned-adm off; systemctl disable tuned
注意
有关 tuned 的详情,请查看 Red Hat Enterprise Linux 7 性能调优指南