调优系统
系统管理员可以基于多种用例工作负载来调整各种设备设置,以此优化系统性能。tuned守护进程会利用反映特定工作负载要求的调优配置文件,以静态和动态两种方式应用调优调整。
配置静态调优 tuned守护进程会在服务启动时或选择新的调优配置文件时应用系统设置。静态调优会对配置文件 中由tuned在运行时应用的预定义kernel参数进行配置。对于静态调优而言,内核参数是针对整 体性能预期而设置的,不会随着活跃度的变化而进行调整。
配置动态调优 对于动态调优而言,tuned守护进程会监视系统活动,并根据运行时行为的变化来调整设置。从所选调优配置文件中声明的初始设置开始,动态调优会不断进行调优调整以适应当前工作负载。
例如,存储设备在启动和登录期间的使用率会比较高,但如果用户工作负载的内容是使用Web浏览 器和电子邮件客户端,则活动量会很少。同样,CPU和网络设备在整个工作日的高峰使用期间会出 现活动增加的情况。tuned守护进程会监视这些组件的活动并调整参数设置,以最大限度提升高活 动量期间的性能,并在低活动量期间降低设置值。tuned守护进程将使用预定义调优配置文件中提 供的性能参数。
选择调优配置文件
Tuned应用提供的配置文件分为以下几个类别:
节能型配置文件
性能提升型配置文件
性能提升型配置文件中包括侧重于以下方面的配置文件:
存储和网络的低延迟
存储和网络的高吞吐量
虚拟机性能
虚拟化主机性能
用法
命令行启动
[root@localhost ~]# mount /dev/sr0 /mnt/
[root@localhost ~]# yum install tuned
[root@localhost ~]# systemctl enable tuned --now #启动 并且之后开机启动
[root@localhost ~]# tuned-adm list
Available profiles:
- balanced - General non-specialized tuned profile
- desktop - Optimize for the desktop use-case
- hpc-compute - Optimize for HPC compute workloads
- 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
- 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: virtual-guest #这里是正在活动的调优配置
# 查看当前活动的配置:
[root@localhost ~]# tuned-adm active
Current active profile: virtual-guest
# 开启配置:
[root@localhost ~]# tuned-adm profile balanced
[root@localhost ~]# tuned-adm active
Current active profile: balanced
web端启动
[root@localhost ~]# yum install httpd -y
[root@localhost ~]# yum install cockpit -y
[root@localhost ~]# systemctl restart httpd
[root@localhost ~]# systemctl restart cockpit.service
在Windows上的浏览器中输入该主机的ip:9090
进入之后的界面:
这里面有很多作用