+4 votes
798 views
How to install and use Tuned CentOS 7 or RHEL automatic tuning performance

in Linux / Unix by (552k points)
reopened | 798 views

1 Answer

+5 votes
Best answer

1. How to install and use tuned on CentOS 7
2. How to create personal tuned profiles in CentOS 7
3. Parameters to use with tuned in CentOS 7

As system administrators, IT personnel or any user of the system or network scope we always have a common goal which is to maximize the performance of services , applications, role, databases and in general every element of both hardware and software within a server and all this has a purpose and is to minimize support tasks and improve the experience of the end user and allow each of the actions that the server performs in the organization to be executed in the best way ..

One of the best tools to optimize the performance of our CentOS or RedHat servers is Tuned and therefore TechnoWikis will make a complete analysis on how it can have a positive impact on the support tasks that we must carry out daily.

What is tuned
Tuned is a Daemon that has been developed to optimize to the maximum the dynamic adjustment of the performance of any Linux server, in this case we talk about CentOS 7 , taking as a starting point the information that it collects during the monitoring process of the system components, and this results in maximum server performance.

When we want to have a high performance server, each system or adjustment tool to use involves time and continuous monitoring which can become a task that involves a high consumption of resources affecting other essential tasks to manage..

The tuned utility was developed as a system service through which it will be possible to select an adjustment profile from one of the nine default profiles in CentOS 7 or we can also use some profile created by us, by default the included profiles are:

  • desktop-powersave
  • enterprise storage
  • server-powersave
  • default
  • throughput-performance
  • laptop-battery-powersave
  • spindown-disk
  • latency-performance
  • laptop-ac-powersave

These adjustment profiles include sysctl settings (/ proc / sys /), disk manager settings, power management options and more scripts that we can add.

To change from one profile to another, just one command is enough, which makes tuned an integral solution to add to cron jobs and it will be possible to make use of the tuned-adm command line tool in order to manage the daemon a time it is running on CentOS 7..


1. How to install and use tuned on CentOS 7

Step 1

In CentOS / RHEL 7 and Fedora distributions, tuned is preinstalled and activated by default, but in previous versions of CentOS / RHEL 6.x, it must be installed using the following command:
 yum install tuned 

image

Enter the letter y to confirm the download and installation of tuned in CentOS 7.

Step 2

After installation, we will have the following configuration files to use:
It is the tuned configuration directory
 / etc / tuned 

It is an email configuration file to receive alerts
 /etc/tuned/tuned-main.conf 

There is stored a subdirectory for all adjustment profiles to use
 / usr / lib / tuned 

Tuned offers predefined profiles to handle various current situations such as high performance, low latency or energy saving, these can be modified with the adjusted rules of each profile and customize how a particular device should be adjusted.

Step 3

A profile is automatically set as default based on the function of the product in use and it will be possible to use the tuned-adm recommend command to determine which profile CentOS 7 recommends as ideal for the server used.

image

Step 4

If there is no recommendation available, the balanced profile is set by default, this profile balances energy consumption, performance and latency. In addition, we have the power-saving profile (powersave), which helps prolong the life of the battery if the portable computer is in an inactive state, or if we only carry out demanding tasks.

If we want to see the complete list of profiles based on the server used, we can execute the following command:

 tuned-adm list 

image

Step 5

Once tuned installed in CentOS 7, we can execute the following commands for administrative tasks:
  • systemctl start tuned (Start the tuned service)
  • systemctl enable tuned (Enables the tuned service at system startup)
  • systemctl status tuned (Check the status of the tuned service)
  • systemctl stop tuned (Stops the tuned service)

image

Step 6

It will also be possible to control tuned using the tuned-adm tool which we can use next to the active parameter to determine the profile currently applied to the server:
 tuned-adm active 

image

Step 7

If we want to change to any of the available profiles, for example, to use the throughput-performance profile, which optimizes the server's workloads to obtain high performance, to carry out this change we will execute the following:
 tuned-adm profile throughput-performance 
We can confirm it by running tuned-adm active:

image

Step 8

With the tuned-adm profile command, we not only configure the profile selection, but in addition to this we also started the daemons and that these are enabled at the startup of CentOS 7.

If we want to disable the tuned utility, we will execute the following:

 tuned-adm off 
When executing this command, not only will all the settings that were before the profile adjustment be performed be reversed, but the adjustment services will also be disabled when the system is started.

2. How to create personal tuned profiles in CentOS 7

Step 1

All tuned tuning profiles have their own subdirectory in / usr / lib / tuned /:

image

So to create a new profile we can copy an existing one, for this case we will rely on the server-powersave profile to create our profile.

Step 2

To do this we will go to the route that stores the subdirectories for all adjustment profiles and there we will create a new subdirectory called test-solvetic for the custom adjustment profile to be created in CentOS 7:
 cd / usr / lib / tuned / mkdir test-solvetic 

image

Step 3

Now we are going to create a tuned.conf configuration file in the directory created:
 nano test-solvetic / tuned.conf 
In the new file we will paste the following:
 [main] include = server-performance summary = TechnoWikis profile test 

image

Step 4

To take into account the following:
  • In the include line we must register the name of the profile to copy
  • In the summary line we enter a summary about the process to be fulfilled
We save the changes using the key combination Ctrl + O and exit the editor using Ctrl + X.

Once this is done we can execute the following command again to verify that our personal profile has been added:

 tuned-adm list 

image

Step 5

To activate our new profile we will execute the following:
 tuned-adm profile test-TechnoWikis 
In all tuned profiles we will find the following files:
tuned.conf:
In this file it will be possible to enable or disable the three main add-ons managed by tuned such as disk, network and CPU. When enabled, these add-ons will control the system and switch to the power saving mode for the subsystems when a low workload occurs.

ktune.sysconfig
In this file you can enable or disable the use of ktune and configure a disk elevator to implement it on hard drives, these disk elevators are queue algorithms used to reorder and merge requests sent to a particular disk.

sysctl.ktune
In this file you can modify the sysctl configuration.

ktune.sh
This script executes two vital functions that are: start () {} and stop () {}. These will call the start function when the profile is activated (including start-up), and the stop function will be called when this profile is deactivated. This file ktune.sh should always generate the file / etc / tune-profiles / functions, which gives us a series of useful functions for power management, disk tuning and much more.

In addition to this, one of the most important functions in this file is a process, which is generally referred to as the $ {@} process at the end of the ktune.sh script whose process function is important since it contains all the default logic to handle the Start, stop and restart the selected profile.


3. Parameters to use with tuned in CentOS 7


Next, we will see some of the options available to use with tuned to optimize our experience.
This option starts tuned as a background Daemon
 -d. –Daemon 

Set the highest record level
 -D, --debug 

Specify the name and path of the configuration file
-
 c, --conffile 

Display tuned help
 -h –help 

Do not attach the DBus parameter
 --no-dbus 

Write the process PID to the PID file
 -P (PID) 

Display the current tuned version
 -v, --version 

To see more help on these utilities we can execute one of the following options:

 man tuned man tuned-adm 
Thus, tuned is a fundamental ally to increase CentOS 7 performance management options.

by (3.5m points)
edited

Related questions

+4 votes
1 answer
+5 votes
1 answer
asked May 12, 2019 in Linux / Unix by backtothefuture (552k points) | 323 views
+4 votes
1 answer
asked Oct 4, 2019 in PHP by backtothefuture (552k points) | 1.6k views
+5 votes
1 answer
asked Sep 2, 2020 in Linux / Unix by backtothefuture (552k points) | 2k views
+3 votes
1 answer
asked Mar 31, 2020 in Linux / Unix by backtothefuture (552k points) | 351 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users