Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is mysql's linux machine optimization method?

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the linux machine optimization method of mysql". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is mysql's linux machine optimization method"?

File system

# echo deadline > / sys/block/sda/queue/scheduler

If you want to take effect permanently, you need to change / etc/grup.conf and add elevator. The example is as follows:

Kernel / vmlinuz-x.x.xx-xxx.el6.x86_64 ro root=UUID=e01d6bb4-bd74-404f-855a-0f700fad4de0 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun1

6 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM elevator=noop rhgb quiet

Memory:

Swappiness and NUMA

Translator's note: it is best to disable swappiness or not to use it in the system logo.

# echo 0 > / proc/sys/vm/swappiness

-0 is not really disabled, but reminds you not to use swap partitions as much as possible. You can set the percentage of swap according to the situation.

Add "vm.swapiness=0" to / etc/sysctl.conf

Using numa's interleave all mode

Numactl-interleave=all starts mysqld

If you use Percona-server, there are options for using numa_interleave in mysql_safe. For more information, see Percona Server's support for numa.

(and don't forget to use innodb_flush_method=O_DIRECT) rformance/innodb_numa_s

Note: you can consider using jemalloc for memory optimization (tokudb,percona uses this method, and the official version needs to be loaded by itself)

CPU: please confirm to turn off the energy saving mode

Check:

For example, "ondemand" runs on the server:

$ps ax | grep kondmand | wc-l

sixty-five

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

Ondemand

Also check whether the tagging frequency of CPU matches the actual frequency:

/ proc/cpuinfo:

Model name: Intel (R) Xeon (R) CPU E5-4640 0 @ 2.40GHz

..

Cpu MHz: 1200.000

Disable ondemand if it does not match (you need to change the configuration in bois)

At this point, I believe you have a deeper understanding of "what is mysql's linux machine optimization method?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report