Linux quickie: Set system tunables according to device profile
Yesterday, I discovered one interesting thing. It’s kind a new for me, but nothing special. There is a useful tool for setting system tunables according to the specific use of machine in RHEL based Linux distros like CentOS etc.
Its name is tuned-adm and you can find it in tuned package. If you don’t have this package installed, it’s easy to install:
yum install tuned
After installation the tool offers you system settings by several profiles:
# tuned-adm list Available profiles: - virtual-host - default - virtual-guest - throughput-performance - laptop-ac-powersave - latency-performance - desktop-powersave - spindown-disk - laptop-battery-powersave - enterprise-storage - server-powersave Current active profile: default
As you can see, there’s a lot of to choose from. The profile is activated very simply:
# tuned-adm profile virtual-host Reverting to saved sysctl settings: [ OK ] Calling '/etc/ktune.d/tunedadm.sh stop': [ OK ] Reverting to cfq elevator: sda sdb [ OK ] Stopping tuned: [ OK ] Switching to profile 'virtual-host' 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 Applying deadline elevator: sda sdb [ OK ] Starting tuned: [ OK ]
Selected profile is also activated on the system startup. If you are interested, the definitions of all profiles are stored in /etc/tune-profiles/. From personal experience I can say that setting the virtual-host profile at one of our KVM machines has significantly decreased load of one virtualized machine. It’s definetely worth a try.