动态优化Linux系统的tuned/tuned-adm工具使用简介

2020-01-30 14:30:05于丽


# vi /etc/tune-profiles/virtual-host/sysctl.ktune
...
#kernel.sched_migration_cost = 5000000
...

# tuned-adm profile virtual-host

如果是企业存储服务器的话,可以用 enterprise-storage 方案:

   
复制代码 # tuned-adm profile enterprise-storage
Stopping tuned: [ OK ]
Switching to profile 'enterprise-storage'
Applying deadline elevator: dm-0 sda sdb sdc sdd [ OK ]
Applying ktune sysctl settings:
/etc/ktune.d/tunedadm.conf: [ OK ]
Calling '/etc/ktune.d/tunedadm.sh start': [ OK ]
Applying sysctl settings from /etc/sysctl.conf
Starting tuned: [ OK ]

上面预定的方案不是总能满足要求,如果有自己的需求可以定制自己的方案。自己定制很容易,切换到优化方案的配置目录,拷贝一个例子,然后编辑里面的相关参数就可以了,使用 tuned-adm list 命令会看到刚创建的新方案 my-virtual-host:

   
复制代码# cd /etc/tune-profiles/
# cp -r virtual-host my-virtual-host
# vi my-virtual-host/*

# tuned-adm list
Available profiles:
- laptop-battery-powersave
- virtual-guest
- desktop-powersave
- sap
- server-powersave
- virtual-host
- throughput-performance
- enterprise-storage
- laptop-ac-powersave
- latency-performance
- spindown-disk
- default
- my-virtual-host
Current active profile: virtual-host