tuned 调的是什么
tuned 是系统和内核参数的调优框架,把一组预设的调优项打包成 profile(配置集),例如面向吞吐的 throughput-performance、面向低延迟的 latency-performance、面向虚拟机的 virtual-guest。切换 profile 相当于一次性调整磁盘预读、CPU 调频策略、内存与网络相关的内核参数,它在 openEuler、麒麟等信创服务器上是常见的性能基线落地方式。
基本信息
| 服务单元 | tuned.service |
|---|---|
| 查看配置集 | tuned-adm list、tuned-adm active |
| 推荐配置集 | tuned-adm recommend |
| 切换 | tuned-adm profile <名称> |
| 自定义 | profile 目录下新增配置或基于现有 profile 派生 |
| 安装 | dnf install -y tuned(先确认源里存在) |
典型使用场景
- 数据库服务器需要面向吞吐或低延迟的基线参数
- 虚拟机内部选用与虚拟化平台匹配的 profile
- 交付前统一各机器的调优基线,便于性能对比
- 性能问题排查时确认是否有人切换过 profile 导致参数漂移
- 节能场景切到 powersave 类 profile 降低能耗
使用流程
使用流程
dnf list tuned # 先确认仓库里有该软件包
dnf install -y tuned # 安装
systemctl enable --now tuned # 开机自启并立即启动
tuned-adm list # 列出可用配置集(available 与 active 分段)
tuned-adm recommend # 让 tuned 按机型给出建议配置集
tuned-adm profile throughput-performance # 切换到面向吞吐的配置集
tuned-adm active # 确认当前生效项,避免改错机器变更留痕与回退
变更留痕与回退
tuned-adm active > /tmp/tuned-before.txt # 切换前记录原配置集,便于回退
tuned-adm profile virtual-guest # 虚拟机场景的常用选择
tuned-adm verify 2>/dev/null | head # 部分版本支持校验当前参数是否符合配置集
cat /sys/kernel/mm/transparent_hugepage/enabled # 抽查关键内核参数是否被调整
systemctl status tuned --no-pager | tail -5 # 看服务是否有报错常见配置集定位
| 配置集 | 面向场景 | 注意事项 |
|---|---|---|
| throughput-performance | 吞吐优先(文件服务、批处理) | 时延敏感业务需评估 |
| latency-performance | 低延迟(数据库交互类) | 可能牺牲部分吞吐与节能 |
| virtual-guest | 虚拟机内部 | 与宿主机调优职责划分清楚 |
| balanced | 默认均衡 | 多数通用业务的稳妥起点 |
| powersave | 节能优先 | 性能敏感场景不建议使用 |
部分信创发行版仓库也提供 tuned,安装前先查询确认:没有该包时可用 cpupower 与内核参数做基础调优,不要照搬其他发行版的包名。
tuned 是系统级改动:切换前记录当前 profile,性能验证通过后再固化到交付规范,出现回退需求时能立刻还原。