玟茵开源社区知识库

如果您有自己的想法或者金点子,请提交给我们或直接参与项目,在此欢迎各位,您的反馈是我们持续前进的动力。
  1. 首页
  2. 技术入门
  3. 正文

Fedora/RHEL动态调优CPU性能模式

2023年4月9日 275点热度 0人点赞 0条评论

主要依赖Tuned

在CentOS / RHEL 7和Fedora上,默认情况下已预先安装并激活了tuned,但在较旧版本的CentOS / RHEL 6.x上,需要使用以下yum命令进行安装。

sudo yum install tuned -y

安装后,您将找到以下重要的调整配置文件。

/etc/tuned - 调整配置目录。
/etc/tuned/tuned-main.conf - 调整的邮件配置文件。
/usr/lib/tuned/ - 存储所有调优配置文件的子目录。

sudo tuned-adm list

列出自带的模式,实际上就是目录/usr/lib/tuned/里的目录对应list出的条目,我们可以自己创建目录写配置文件来定制一个模式。

Available profiles:
- accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states
- balanced - General non-specialized tuned profile
- desktop - Optimize for the desktop use-case
- hpc-compute - Optimize for HPC compute workloads
- intel-sst - Configure for Intel Speed Select Base Frequency
- latency-performance - Optimize for deterministic performance at the cost of increased power consumption
- network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance
- network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks
- optimize-serial-console - Optimize for serial console use.
- powersave - Optimize for low power consumption
- throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads
- virtual-guest - Optimize for running inside a virtual guest
- virtual-host - Optimize for running KVM guests
Current active profile: desktop

常用模式介绍:

  • balanced

它的目的是成为性能和功耗之间的折衷。它试图尽量使用自动调节。它有好的结果对于大多数负载。唯一的缺点是增加了延迟。在当前调释放它使CPU、磁盘、音频和视频插件和激活ondemand调控器。radeon_powersave设置为自动。

  • desktop

针对桌面系统设计的节能Profile,对SATA适配器、CPU、网络和磁盘插件应用ALPM策略

  • latency-performance

典型低延迟的性能模式。此配置会禁用动态调整机制和透明的大页面。cpuspeed模式改变为performance,将性能低的CPU锁定C状态(通过PM QoS)。同时将磁盘 IO 的调度算法更改为 deadline,在Red Hat Enterprise Linux 6.5和更高版本中cpu_dma_latency参数的值注册为1(可能的最低延迟,早期值为0),用于电源管理服务质量,以尽可能限制延迟。

  • throughput-performance

高吞吐量优化模式。用于典型吞吐量性能调整的服务器配置文件,它禁止 tuned 和 ktune 节能机制。如果系统没有企业级存储,则建议使用此配置文件。与相同latency-performance,除了:

  • kernel.sched_wakeup_granularity_ns(调度程序唤醒粒度)设置为15毫秒
  • vm.dirty_ratio 设置为40%: 脏数据限制,内存里的脏数据百分比不能超过这个值。如果脏数据超过这个数量,新的IO请求将会被阻挡,直到脏数据被写进磁盘。这是造成IO卡顿的重要原因,但这也是保证内存中不会存在过量脏数据的保护机制
  • 透明的大页面已启用
  • virtual-guest

基于企业存储配置文件,在其他任务,增加虚拟内存swappiness和减少磁盘预读值。它没有禁用磁盘屏障。

  • oracle

基于throughput-performance模式,它另外禁用透明的巨大的页面和修改内核参数相关的一些其他性能。这个配置文件是由tuned-profiles-oracle包。在6.8及以后版本可用。

  • network-latency

包括“latency-performance”,禁用 transparent_hugepages,禁用 NUMA 平衡并启用一些基于延迟的网络调整。

  • network-throughput

包括“throughput-performance”,并增加网络堆栈缓冲区大小。

获取当前模式

 

sudo tuned-adm active

Current active profile: balanced
sudo tuned-adm profile_mode
Profile selection mode: auto

切换到throughput-performance模式

sudo tuned-adm profile throughput-performance

切换到network-throughput模式

sudo tuned-adm profile network-throughput

切换到network-latency模式

sudo tuned-adm profile network-latency

本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可
标签: 暂无
最后更新:2023年4月13日

WenYinOS

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

COPYLEFT © 2023 玟茵开源社区知识库. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang