One. NUMA settings
Standalone single instance, it is recommended to turn off NUMA, there are three ways to shut down:
1. Hardware layer, set off in BIOS;
2.OS kernel, set numa=off at startup;
3. You can modify the memory allocation policy to Interleave (cross) with the Numactl command
Method 3
Modify Mysql.server 330 lines plus numactl
Vi/opt/mysql/bin/mysql.server
- /usr/bin/numactl--interleave all $bindir/mysqld_safe--datadir= $datadir--pid-file= $server _pid_file $other _args > /dev/null 2>&1 &
- Wait_for_pid created $!; Return_value=$?
Numastat Viewing memory Allocations
- node0 node1
- numa_hit& nbsp 56506002860 201877592362
- numa_miss & nbsp 9099468163 1450668930
- numa_foreign 1450668930 9099468163
- interleave_hit & nbsp; 6205106 4793392
- local_node 56485823400 201848609519
- other_node & nbsp; 9119647623 1479651773
Two. IO Scheduling algorithm
Linux has four IO scheduling algorithms: Cfq,deadline,anticipatory and NOOP,CFQ are the default IO scheduling algorithms. Under completely random access environment, the performance difference between CFQ and Deadline,noop is very small, but once a large continuous IO,CFQ may cause the response delay of small IO to increase, the database environment is proposed to be modified to deadline algorithm, and the performance is more stable.
The IO scheduling algorithm is based on disk design, so reducing head movement is one of the most important considerations, but after using flash storage devices, you no longer need to consider the problem of head movement, you can use the NOOP algorithm. The meaning of NoOp is nonoperation, which means that no IO optimizations are done, and the IO is handled exactly as requested in a FIFO manner.
IO Scheduler, default CFQ
echo ' deadline ' >/sys/block/sdb/queue/scheduler
Cat/sys/block/sdb/queue/scheduler
- NoOp anticipatory [deadline] Cfq
Reduced read-ahead, default 128
Echo ' >/sys/block/sda/queue/read_ahead_kb
Increase queue, default 128
echo '/sys/block/sda/queue/nr_requests ' >
Try not to use swap zones, default 60
echo ' 0 ' >/proc/sys/vm/swappiness
Start-up operation
Vi/etc/rc.local
- echo ' deadline ' >/sys/block/sdb/queue/scheduler
- Echo ' >/sys/block/sda/queue/read_ahead_kb
- echo '/sys/block/sda/queue/nr_requests ' >
Vi/etc/sysctl.conf
modifying Numa and IO scheduling to optimize MySQL performance