Performance tuning linux servers

Tuned – Automatic Performance Tuning of CentOS/RHEL Servers

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.

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.

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.

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.

How to Install Tuned on CentOS/RHEL & Fedora

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.

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

  • /etc/tuned – tuned configuration directory.
  • /etc/tuned/tuned-main.conf– tuned mail configuration file.
  • /usr/lib/tuned/ – stores a sub-directory for all tuning profiles.

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

--------------- On RHEL/CentOS 7 --------------- # systemctl start tuned # systemctl enable tuned # systemctl status tuned # systemctl stop tuned --------------- On RHEL/CentOS 6 --------------- # service tuned start # chkconfig tuned on # service tuned status # service tuned stop

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.

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

Читайте также:  Линукс установка драйверов интел

Check Current Tuned Profile

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

List Available Tuned Profiles

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.

# tuned-adm profile throughput-performance # tuned-adm active

Switch to Tuning Profile

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

And you can disable all tuning as shown.

How To Create Custom Tuning Profiles

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.

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.

# cd /usr/lib/tuned/ # mkdir test-performance

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

# vim test-performance/tuned.conf

Copy and paste the following configuration in the file.

[main] include=latency-performance summary=Test profile that uses settings for latency-performance tuning profile

Save the file and close it.

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

Check New Tuned Profile

To activate new tuned profile, issue following command.

# tuned-adm profile test-performance

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

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.

Источник

Оптимизация Linux с помощью tuned

Демон tuned позволяет автоматически оптимизировать производительность Linux сервера под различные задачи.

Служба tuned отслеживает различные компоненты использование системы и динамически, исходя из полученных данных, изменять настройки системы.

Профили tuned

tunes имеет множество профилей настройки. которые позволяют оптимизировать настройки системы в зависимости от задач.

Установка Tuned

Установка в CentOS

Tuned по умолчанию установлен в RHEL / CentOS 7/8/Strem. Не включен в тип установки minimal.

yum install tuned systemctl enable --now tuned

Установка в Debian/Ubuntu

apt update apt install tuned tuned-utils tuned-utils-systemtap

Проверка текущего профиля tuned

tuned-adm active Current active profile: virtual-guest

Проверка рекомендуемого профиля tuned для сервера Linux

На основе различных характеристик системы tuned рекомендует один из имеющихся профилей.

tuned-adm recommend virtual-guest

Просмотр доступных профилей tuned

Список профилей может отличатся в зависимости от типа операционной системы

# tuned-adm list Available profiles: - accelerator-performance - Throughput performance based tuning with disabled higher latency STOP states - balanced - General non-specialized tuned profile - desktop - Optimize for the desktop use-case - hpc-compute - Optimize for HPC compute workloads - intel-sst - Configure for Intel Speed Select Base Frequency - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - optimize-serial-console - Optimize for serial console use. - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads - virtual-guest - Optimize for running inside a virtual guest - virtual-host - Optimize for running KVM guests Current active profile: virtual-guest

Установка профиля tuned

tuned-adm profile tuned-adm active

Где ими профиля, active необходима для подтверждения изменений.

tuned-adm profile throughput-performance tuned-adm active 

Отключение tuned

Если по какой-то причине не требуется автоматическая оптимизация, tuned можно отключить

tuned-adm off tuned-adm active

Источник

Читайте также:  Ssh подключение через терминал линукс

👍 Как оптимизировать производительность системы Linux с помощью tuned-adm

Как системный администратор, вы должны иметь возможность оптимизировать производительность системы Linux в соответствии с вашими рабочими нагрузками, регулируя различные параметры.

Э то руководство было написано для того, чтобы помочь вам оптимизировать производительность вашего сервера Linux с настройками.

Настроенный демон может использоваться для применения настроек системы в динамическом или статическом режиме.

Существуют предварительно определенные профили настройки, которые отражают конкретные требования к рабочей нагрузке.

П озволяет использовать дополнительные параметры настройки сети для обеспечения низкой задержки сети.

Статическая настройка

В этом методе настройки настроенный демон применяет системные настройки при запуске службы или при выборе нового профиля настройки.

Параметры ядра устанавливаются для общих ожиданий производительности и не корректируются при изменении уровней активности.

Динамическая настройка

При динамической настройке настроенный демон отслеживает активность системы и корректирует настройки в зависимости от изменений поведения во время выполнения.

Динамическая настройка непрерывно регулирует настройку в соответствии с текущей рабочей нагрузкой, начиная с начальных настроек, объявленных в выбранном профиле настройки.

Установка Tuned

В системе Linux RHEL / CentOS 8/7 пакет установлен и включен по умолчанию.

Если вы хотите установить и включить пакет вручную на компьютере CentOS / RHEL, выполните команды:

sudo yum install tuned sudo systemctl enable --now tuned
sudo apt update sudo apt install tuned tuned-utils tuned-utils-systemtap

Подтвердите статус сервиса после его запуска.

$ systemctl status tuned ● tuned.service - Dynamic System Tuning Daemon Loaded: loaded (/usr/lib/systemd/system/tuned.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2020-02-04 04:10:52 UTC; 6 days ago Docs: man:tuned(8) man:tuned.conf(5) man:tuned-adm(8) Main PID: 936 (tuned) CGroup: /system.slice/tuned.service └─936 /usr/bin/python2 -Es /usr/sbin/tuned -l -P . 

Выбор профиля tuned

Настроенные профили делятся на следующие категории:

  • Низкая задержка хранения и сети
  • Высокая пропускная способность для хранения и сети
  • Производительность хоста виртуализации
  • Производительность виртуальной машины
Читайте также:  Linux белые ip адреса

Мы будем использовать команду tuned-adm для изменения настроек демона tuned.

$ tuned-adm active Current active profile: virtual-guest
Available profiles: - balanced - General non-specialized tuned profile - desktop - Optimize for the desktop use-case - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - powersave - Optimize for low power consumption - throughput-performance - Broadly applicable tuning that provides excellent performance across a variety of common server workloads - virtual-guest - Optimize for running inside a virtual guest - virtual-host - Optimize for running KVM guests Current active profile: virtual-guest

В Ubuntu доступно больше профилей:

$ tuned-adm list Available profiles: - atomic-guest - Optimize virtual guests based on the Atomic variant - atomic-host - Optimize bare metal systems running the Atomic variant - balanced - General non-specialized tuned profile - cpu-partitioning - Optimize for CPU partitioning - default - Legacy default tuned profile - desktop - Optimize for the desktop use-case - desktop-powersave - Optmize for the desktop use-case with power saving - enterprise-storage - Legacy profile for RHEL6, for RHEL7, please use throughput-performance profile - laptop-ac-powersave - Optimize for laptop with power savings - laptop-battery-powersave - Optimize laptop profile with more aggressive power saving - latency-performance - Optimize for deterministic performance at the cost of increased power consumption - network-latency - Optimize for deterministic performance at the cost of increased power consumption, focused on low latency network performance - network-throughput - Optimize for streaming network throughput, generally only necessary on older CPUs or 40G+ networks - oracle - Optimize for Oracle RDBMS - powersave - Optimize for low power consumption - realtime - Optimize for realtime workloads - realtime-virtual-guest - Optimize for realtime workloads running within a KVM guest - realtime-virtual-host - Optimize for KVM guests running realtime workloads - sap-hana - Optimize for SAP HANA - sap-hana-vmware - Optimize for SAP HANA running inside a VMware guest - sap-netweaver - Optimize for SAP NetWeaver - server-powersave - Optimize for server power savings

Команда tuned-adm profile используется для переключения активного профиля на другой.

sudo tuned-adm profile throughput-performance

Источник

Оцените статью
Adblock
detector