Support >
  About independent server >
  Automatically tune CentOS/RHEL server performance with Tuned
Automatically tune CentOS/RHEL server performance with Tuned
Time : 2024-12-10 14:44:23
Edit : Jtti

Tuned can be used in CentOS/RHEL systems to automatically tune system performance and dynamically optimize system parameters based on server workload and requirements. Tuned provides preset performance profiles that can be adapted to different usage environments, such as databases, file servers, web servers, and so on, to improve the overall performance and responsiveness of your system. Here are some basic steps for automatic performance tuning with Tuned:

On CentOS/RHEL systems, you can install Tuned using the package manager:

sudo yum install tuned

To view the available Profiles:

After the installation is complete, you can view all available preset profiles.

tuned-adm list

To enable a profile, select an appropriate profile based on the server's purpose and enable it.

tuned-adm profile <profile-name>

For example, if the server is primarily used for databases, you can select the oltp profile:

tuned-adm profile oltp

Create a custom profile:

If the preset configuration file does not meet the requirements, create a custom configuration file. tuned allows editing the configuration file in the /etc/tuned/ directory.

Monitor and adjust. You can view the currently active profile using the tuned-adm active command.

tuned-adm active

You may need to adjust the parameters in the configuration file based on the actual system performance.

Tuned can also automatically detect system workloads and dynamically adjust parameters through plug-ins. For example, the powersave plug-in can reduce the CPU frequency to save energy when the system is under low load.

For those who want to use a graphical interface, Tuned provides the tuned gui tool, which can be found and used through the system's Tools menu.

Tuned is a powerful tool that can help system administrators optimize server performance, but it also needs to be configured and tuned appropriately. Using Tuned correctly can significantly improve server productivity and resource utilization. Periodically evaluating the impact of Tuned on server performance can ensure system optimization and performance improvement. For example, you can use the monitoring tool tuned adm to monitor the effect of the current configuration file in real time:

tuned-adm active

The command displays the current active profile and some key performance parameters.

You can also use the sar command, which is the system activity reporting period and provides historical performance data:

sar -u

This command displays historical CPU usage data to help understand performance changes.

You can also use the vmstat command, which provides real-time data about processes, memory, paging, block I/O, traps, and CPU activity:

vmstat 1

This command is updated every second and displays key indicators of server performance.

About the performance analysis tool, you can use the perf tool, you can analyze the system performance:

perf record

sudo perf report

The above commands can help record and report system performance, especially under specific operations.

iostat is used to monitor system input/output device load:

iostat 1

This command is updated every second and displays key indicators of I/O performance.

You can also periodically check your system logs, especially /var/log/messages or /var/log/syslog, for performance-related warnings or errors. Run performance analysis scripts periodically using at or cron tasks and generate reports. Compare performance metrics, such as CPU usage, memory usage, I/O performance, and more, before and after applying Tuned configuration.

Use mpstat to monitor the performance of multi-core cpus:

mpstat -P ALL 1

This command displays the performance data of all cpus and is updated once every second.

You can also monitor system performance in real time with visualization tools such as htop or top, and use nmon to provide a visual interface for performance data. Monitor network traffic and loan usage with iftop or bmon. You can also write scripts to collect performance data and analyze it using tools such as awk and grep.

JTTI-Defl
JTTI-COCO
JTTI-Selina
JTTI-Ellis
JTTI-Eom