Linux optimized for running MySQL "turn"

Source: Internet
Author: User
Tags percona percona server

Because many of the MySQL production environments are under Linux, I decided to point out some important optimizations for Linux running MySQL. This is what everyone knows, and nothing new, but I want to collect and collate Linux-related configuration optimization experiences in this blog.

File system:
Use the Notime option when EXT4 (or XFS) mount
File system scheduling policy: using Deadline or NoOp

# echo Deadline >/sys/block/sda/queue/scheduleradd "Elevator=deadline" to grub.conf

Translator recommendation: XFS, currently in Red Hat Enterprise 7 after XFS became the default file system.

Memory:
Swappiness and NUMA
Translator Note: It is best to ban swappiness or not use it in the system logo.

# echo 0 >/proc/sys/vm/swappinessadd "vm.swapiness=0" to/etc/sysctl.conf

Using Numa's Interleave all mode
Numactl–interleave=all Start mysqld
If you use Percona-server in Mysql_safe, there are options for using Numa_interleave. More about information you can view Percona server support for NUMA

(And don't forget to use Innodb_flush_method=o_direct) rformance/innodb_numa_s

Translator Note: Memory optimization This block can be considered using Jemalloc (Tokudb,percona all have to use this way, the official version needs to be self-loaded)

Cpu:
Verify that the low power (powersave) option for the CPU is enabled
Check:

/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

Verify that the OnDemand is shown here and that the Power saving mode is enabled.

Also check the/proc/cpuinfo and compare the number of CPU MHz to whether the number shown after "model name" is the same
If OnDemand is used, disable him.

For example: "OnDemand" runs on the server:

$ps Ax|grep kondmand|wc-l65$ Cat/sys/devices/system/cpu/cpu0/cpufreq/scaling_governorondemand

Also see if the CPU's label frequency matches the actual frequency:

/proc/cpuinfo:model Name:intel (R) Xeon (r) CPU e5-4640 0 @ 2.40GHz. CPU mhz:1200.000

If not, disable OnDemand (you need to change the configuration in the Bois)

Translator Note: If the CPU exceeds 24 cores, it is recommended to use the later version of MySQL5.6.

Linux optimized for running MySQL "turn"

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.