Use the tuned/tuned-adm tool to dynamically tune your CentOS system tutorial

Source: Internet
Author: User
Tags centos

What is tuned/tuned-adm?

Tuned/tuned-adm is a new system tuning tool introduced after CentOS 6.3. tuned is a server program used to monitor and collect data of various system components, the system settings are dynamically adjusted based on the information provided by the data to achieve the purpose of dynamic optimization of the system; tuned-adm is a client program, used to deal with tuned, managed and configured in command line, tuned-adm provides some pre-configured optimization solutions for direct use, such as laptops, virtual machines, and storage servers.

If you are using a laptop (battery power supply) and want to optimize the system, save power, and do not want to know too much details about this, you can use the tuned/tuned-adm tool and use the laptop-battery-powersave solution to adjust and optimize the system. Of course, there are different optimization schemes for different systems and application scenarios. The pre-configured optimization policies of tuned-adm do not always meet the requirements. At this time, you need to customize them, tuned-adm allows you to create and customize new tuning schemes.

System performance optimization is a big topic. If you are interested in this aspect, refer to the Linux performance monitoring series of articles:
Introduction: CPU, Memory, IO, Network, Tools.

Install and start tuned:

# Yum update
# Yum install tuned

# Service tuned start
# Chkconfig tuned on

# Service ktune start
# Chkconfig ktune on

View the current optimization scheme:

# Tuned-adm active
Current active profile: default
Service tuned: enabled, running
Service ktune: enabled, running

View the pre-configured optimization scheme:

# Tuned-adm list
Available profiles:
-Laptop-battery-powersave
-Virtual-guest
-Desktop-powersave
-Sap
-Server-powersave
-Virtual-host
-Throughput-performance
-Enterprise-storage
-Laptop-ac-powersave
-Latency-performance
-Spindown-disk
-Default
Current active profile: default

If the server is a VM, you can use the virtual-host solution for optimization. If the error "kernel. sched_migration_cost" is an unknown key, you can solve this problem by editing the sysctl. ktune file.

# 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 sdc sdd sde sdf sdg [OK]
Stopping tuned: [OK]
Switching to profile 'virtual-host'
Applying deadline elevator: sda sdb sdc sdd sde sdf sdg [OK]
Applying ktune sysctl settings:
/Etc/ktune. d/tunedadm. conf: [FAILED]
Error: "kernel. sched_migration_cost" is an unknown key

Calling'/etc/ktune. d/tunedadm. sh start': [OK]
Applying sysctl settings from/etc/sysctl. conf
Starting tuned: [OK]

# Vi/etc/tune-profiles/virtual-host/sysctl. ktune
...
# Kernel. sched_migration_cost = 5000000
...

# Tuned-adm profile virtual-host

For enterprise storage servers, you can use the enterprise-storage solution:

# Tuned-adm profile enterprise-storage
Stopping tuned: [OK]
Switching to profile 'enterprise-store'
Applying deadline elevator: dm-0 sda sdb sdc sdd [OK]
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
Starting tuned: [OK]

The above plan does not always meet the requirements. If you have your own requirements, you can customize your own plan. It is easy to customize by yourself. Switch to the configuration Directory of the optimization solution, copy an example, and edit the relevant parameters, run the tuned-adm list command to view the newly created solution my-virtual-host:

# Cd/etc/tune-profiles/
# Cp-r virtual-host my-virtual-host
# Vi my-virtual-host /*

# Tuned-adm list
Available profiles:
-Laptop-battery-powersave
-Virtual-guest
-Desktop-powersave
-Sap
-Server-powersave
-Virtual-host
-Throughput-performance
-Enterprise-storage
-Laptop-ac-powersave
-Latency-performance
-Spindown-disk
-Default
-My-virtual-host
Current active profile: virtual-host

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.