Tuned – Automatic Performance Tuning of CentOS/RHEL Servers

[‘

n

To maximize the end-to-end performance of services, applications and databases on a server, system administrators usually carry out custom performance tunning, using various tools, both generic operating system tools as well as third-party tools. One of the most useful performance tuning tools on CentOS/RHEL/Fedora Linux is Tuned.

n

Read Also: 20 Commad Line Tools Monitor Linux Performance

n

Tuned is a powerful daemon for dynamically auto-tuning Linux server performance based on information it gathers from monitoring use of system components, to squeeze maximum performance out of a server.

n

It does this by tuning system settings dynamically on the fly depending on system activity, using tuning profiles. Tuning profiles include sysctl configs, disk-elevators configs, transparent hugepages, power management options and your custom scripts.

n

By default tuned will not dynamically adjust system settings, but you can modify how the tuned daemon operates and allow it to dynamically alter settings based on system usage. You can use the tuned-adm command-line tool to manage the daemon once it is running.

n

How to Install Tuned on CentOS/RHEL & Fedora

n

On CentOS/RHEL 7 and Fedora, tuned comes pre-installed and activated by default, but on older version of CentOS/RHEL 6.x, you need to install it using the following yum command.

n

# yum install tunedrn

n

After the installation, you will find following important tuned configuration files.

n

    n

  • /etc/tuned – tuned configuration directory.
  • n

  • /etc/tuned/tuned-main.conf– tuned mail configuration file.
  • n

  • /usr/lib/tuned/ – stores a sub-directory for all tuning profiles.
  • n

n

Now you can start or manage the tuned service using following commands.

n

--------------- On RHEL/CentOS 7 --------------- rn# systemctl start tunedt        rn# systemctl enable tunedtrn# systemctl status tunedtrn# systemctl stop tunedttrnrn--------------- On RHEL/CentOS 6 ---------------rn# service tuned startrn# chkconfig tuned onrn# service tuned statusrn# service tuned stoprn

n

Now you can control tuned using the tunde-adm tool. There are a number of predefined tuning profiles already included for some common use cases. You can check the current active profile with following command.

n

# tuned-adm activern

n

From the output of the above command, the test system (which is a Linode VPS) is optimized for running as a virtual guest.

n

Check Current Tuned Profile
Check Current Tuned Profile

n

You can get a list of available tuning profiles using following command.

n

# tuned-adm listrn

n

List Available Tuned Profiles
List Available Tuned Profiles

n

To switch to any of the available profiles for example throughput-performance – a tuning which results into excellent performance across a variety of common server workloads.

n

# tuned-adm  profile throughput-performancern# tuned-adm activern

n

Switch to Tuning Profile
Switch to Tuning Profile

n

To use the recommended profile for your system, run the following command.

n

# tuned-adm recommendrn

n

And you can disable all tuning as shown.

n

 rn# tuned-adm offrn

n

How To Create Custom Tuning Profiles

n

You can also create new profiles, we will create a new profile called test-performance which will use settings from an existing profile called latency-performance.

n

Switch into the path which stores sub-directories for all tuning profiles, create a new sub-directory called test-performance for your custom tuning profile there.

n

# cd /usr/lib/tuned/rn# mkdir test-performancern

n

Then create a tuned.conf configuration file in the directory.

n

# vim test-performance/tuned.confrn

n

Copy and paste the following configuration in the file.

n

[main]rninclude=latency-performancernsummary=Test profile that uses settings for latency-performance tuning profilern

n

Save the file and close it.

n

If you run the tuned-adm list command again, the new tuning profile should exist in the list of available profiles.

n

# tuned-adm listrn

n

Check New Tuned Profile
Check New Tuned Profile

n

To activate new tuned profile, issue following command.

n

# tuned-adm  profile test-performancern

n

For more information and further tinkering options, see the tuned and tuned-adm man pages.

n

# man tunedrn# man tuned-admrn

n

Tuned Github repository: https://github.com/fcelda/tuned

n

That’s all for now! Tuned is a daemon that monitors usage of system components and dynamically auto-tunes a Linux server for maximum performance. If you have any questions or thoughts to share, use the feedback form below to reach us.

n

‘]