Server Preparation:
Server
|
Memory |
Cpu |
Ssds |
Ip |
OS |
DB1 |
32GB |
4 cores |
300GB |
10.0.10.10/32 |
centos6.5 x64 |
DB2 |
32GB |
4 cores |
300GB |
10.0.10.11/32 |
centos6.5 x64 |
DB3 |
32GB |
4 cores |
300GB |
10.0.10.12/32 |
centos6.5 x64 |
First, the CPU parameter adjustment
Maximum performance of the CPU in the BIOS setting of the server
1, choose Performance Per Watt Optimized (DAPC) mode, play CPU maximum performance, run DB This usually requires a high computational capacity of the service should not consider power-saving;
2, close c1e and C states and other options, the purpose is to improve CPU efficiency;
3. Frequency (Memory frequency) Select Maximum performance (best performance);
4. In the Memory Settings menu, enable node interleaving to avoid NUMA issues;
Second, operating system IO scheduling
Cat/sys/block/xvdb/queue/scheduler
Linux default IO scheduling algorithm for CFQ, need to be modified to dealine, if it is SSD or PCIE-SSD device, need to change to NoOp, you can use the following two ways to modify.
1, online dynamic modification, restart failure.
echo NoOp >/sys/block/sda/queue/scheduler
Tips: The SDA here represents the hard drive you need to modify, based on your actual situation.
2, modification/etc/grub.conf permanent effect.
Modify the/etc/grub.conf configuration file to add a configuration to the kernel line, for example:
kernel/vmlinuz-2.6.32-642.1.1.el6.x86_64 ro root=/dev/mapper/vg_centos-lv_root Rd_no_luks rd_LVM_LV=vg_centos/lv_ Swap RD_NO_MD Crashkernel=auto LANG=ZH_CN. UTF-8 rd_lvm_lv=vg_centos/lv_root keyboardtype=pc keytable=us rd_no_dm rhgb quiet elevator=noof Numa=off
Elevator=noof
Numa=off #禁用numa特性
Third, file system XFS OR EXT4
File system mount parameters, we recommend using Noatime,nobarrier two options
/dev/xvdb1/data XFS default,noatime,nobarrier 0 0
Four, memory
Vim/etc/sysctl.conf
Vm.swappiness=0 #利用完物理内存再用交接分区
Vm.dirty_ratio=5 # The percentage of dirty data in memory cannot exceed this value. If the dirty data exceeds this amount, the new IO request will be blocked until the dirty data is written into the disk. This is an important cause of IO lag, but it is also a protection against excessive dirty data in memory
Iv. Network
Vim/etc/sysctl.conf
Net.core.somaxconn = 1024
Net.core.rmem_max = 16777216
Net.core.wmem_max = 16777216
Net.ipv4.tcp_max_syn_backlog =8192
net.ipv4.ip_local_port_range=1024 64000
Net.ipv4.tcp_rmem = 4096 87380 16777216
Net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.max_tw_buckets=360000
Net.core.netdev_max_backlog = 2500
Net.ipv4.tcp_tw_recycle=1
Net.ipv4.tcp_tw_reuse=1
Net.ipv4.tcp_syncookies = 1
Net.ipv4.tcp_fin_timeout = 30
V. Adding file descriptors
Dynamic modification: Ulimt-n 51200
Permanent effect
Vim/etc/security/limits.conf
* Soft Nofile 81920
* Hard Nofile 81920
* Soft Nproc 81920
* Hard Nproc 81920
This article is from the "11095126" blog, please be sure to keep this source http://11105126.blog.51cto.com/11095126/1880376
Percona XTRADB cluster 5.5 cluster production environment installation