tuned-adm profile throughput-performance 可直接切换吞吐模式,但需确保 tuned 服务已启动、throughput-performance 配置集存在且系统兼容;否则会因服务未启、命令缺失、profile 未安装或内核参数写入失败导致静默失效。

直接用 tuned-adm profile throughput-performance 就能切,但前提是 tuned 服务已运行,且该配置集确实存在 —— 很多用户卡在这一步,不是命令输错,而是服务没启、配置没装、或发行版不带这个 profile。
确认 tuned 服务已启动并启用
没跑起来的服务,再好的 profile 也加载不了。常见错误是执行 tuned-adm 命令时报 Connection refused 或直接提示 command not found。
- 检查服务状态:
systemctl status tuned,若显示inactive (dead)或not found,说明没装或没启 - RHEL/CentOS:运行
yum install -y tuned && systemctl enable --now tuned - Ubuntu/Debian:运行
apt update && apt install -y tuned tuned-utils && systemctl enable --now tuned - 注意:某些最小化安装的 Ubuntu(如 cloud-init 镜像)默认不带
tuned-utils,缺它会导致tuned-adm命令不可用
验证 throughput-performance 是否可用
不是所有系统都预装了 throughput-performance。比如部分旧版 CentOS 7 或裁剪过的容器镜像里只有 balanced 和 powersave。
- 运行
tuned-adm list,在输出中查找throughput-performance行;若没出现,说明该 profile 未部署 - 检查配置目录是否存在:
ls /usr/lib/tuned/throughput-performance/;若报No such file,需手动补全(见下一条) - 部分发行版把 profile 放在
/lib/tuned/(如较新 Ubuntu),可同步检查:ls /lib/tuned/throughput-performance/
一键切换并验证是否生效
切换本身极快,无需重启、无需 reload,但生效后必须验证,因为 silent failure 很常见(比如某项内核参数被其他机制覆盖)。
- 执行切换:
tuned-adm profile throughput-performance - 立即验证:
tuned-adm active,输出应为Current active profile: throughput-performance - 关键验证点:检查实际生效的内核参数,例如
vm.swappiness应降到 1(cat /proc/sys/vm/swappiness),vm.dirty_ratio通常升到 40+;若仍是默认值(如 swappiness=60),说明 profile 没真正应用 - 若失败,看 journal:
journalctl -u tuned -n 50 --no-pager,常见报错如Failed to apply sysctl(权限不足)或Cannot set governor(cpupower 工具缺失)
容易被忽略的兼容性问题
throughput-performance 不是“开箱即用”的万能模式,它对硬件和内核有隐含要求。
- 它会尝试设置 CPU governor 为
performance,但若系统使用 intel_pstate 驱动且启用了 turbo boost,还需额外确认:cpupower frequency-info --governors输出中是否含performance - 某些云主机(如 AWS EC2 t 系列、Azure B 系列)因底层限制,无法真正锁定 CPU 频率,此时 profile 会降级应用其余参数,但吞吐提升有限
- 容器环境(尤其是 rootless Podman 或 Docker with seccomp)可能拦截
sysctl写入,导致内存/IO 参数不生效,需在容器 runtime 配置中显式放开sys_admin能力


















