Database Server Installation Standard
(1). BIOS optimization, array configuration
1.1: Turn off the CPU power saving, because the server brand is numerous, the BIOS setting is not the same, mainly turn off CPU energy saving, such as c1,dellr730, has been smart settings, directly have a performance option, to help you turn off the CPU energy saving, NUMA features
1.2: Fruit Server is 8 hard disk, we recommend two block to do RAID1 system, the remaining 6 block do RAID10 do data partition, RAID1 array cache set to Writethrough will be limited array card cache to RAID10 array, if it is more than 8 disks, set up two groups of RAID10, An assembled system and data that holds sequential IO types, such as Redolog, archive logs, MySQL Binlog, a set of data partitions
1.3: Using XFS file system, data partitioning with XFS file system, mount parameters with defaults,noatime,nodiratime,nobarrier, remember that the root partition is not able to use this mount parameter, or the directory under your root partition has no access time, modification time, only for the database file partition
1.4: Modify the IO scheduling policy and close numa:vim/etc/grub.conf at the end of kernel line plus elevtor= Deadline Numa=off
kernel/vmlinuz-2.6.32-504.el6.x86_64 ro Root=uuid=af13b3dc-c142-42b7-8ed6-cb7c60608af2 rd_NO_LUKS KEYBOARDTYPE=PC keytable=us rd_no_md Crashkernel=auto lang=zh_cn. UTF-8 RD_NO_LVM rd_no_dm rhgb quiet Elevator=deadline Numa=off
To be effective now, you can set this
Cat/sys/block/sda/queue/scheduler
echo Deadline >/sys/block/sda/queue/scheduler
(2) Operating system base optimization
2.1: Turn off SELinux, modify resource configuration
Vim/etc/security/limits.conf
Add the following paragraph
* Soft Nofile 65535
* Soft Nproc 65535
* Hard Nofile 65535
* Hard Nproc 65535
Sed-ri ' s/selinux=enforcing/selinux=disabled/g '/etc/selinux/config
currently set SELinux and resource limit setenforce 0 and then in Getenforce, set resource limits, direct ulimit-n 65535
2.2: Turn off unwanted services, leaving only crond,network,rsyslog,sshd, Sysstat,udev-post
2.3: Kernel parameter tuning
######## #减少swap的使用率建议5-10, is not recommended to set to 0, in order to avoid the occurrence of oom, if high availability to do well, directly let Oom, because using Swap,mysql basic cannot use the
vm.swappiness=10
###### Ensures that dirty data can be flushed to disk continuously, avoiding momentary I/O writes, creating severe waits and setting innodb_max_dirty_pages_pct in MySQL a little bit like the principle of
Vm.dirty_ratio=20
Vm.dirty_ background_ratio=10
###################### #减少TIME_WAIT to improve TCP efficiency;
Net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_tw_reuse=1
(3) Installing the Jemalloc memory Manager
http://www.canonware.com/download/jemalloc/jemalloc-3.6.0.tar.bz2
compilation installation is simple, tar xvf jemalloc-3.6.0.tar.bz2 ./configure && make && make install
has been easy to install after the use of MySQL, the use is also very simple in [Mysqld_safe] plus malloc-lib=/usr/local/lib/libjemalloc.so
Database Server Installation Standard