????1?????????????
????1.1??CPU???
?????????????BIOS?????У???????????????????????????CPU?????????????????NUMA????
????1?????Performance Per Watt Optimized(DAPC)????????CPU?????????DB?????????????????????????????????
????2?????C1E??C States??????????????????CPUЧ???
????3??Memory Frequency????????????Maximum Performance???????????
????4????????ò???У?????Node Interleaving??????NUMA????
????1.2??????I/O???
???????漸???????IOPS????????????????????????I/O????????Щ?????
????1?????SSD????PCIe SSD?豸?????????????????????IOPS??????
????2?????????п?????CACHE??BBU??飬??????????IOPS??????????е???SSD??PCIe SSD???????????????CACHE??BBU???????????????????????????????????
????3???????п????????????д?????WB??????FORCE WB????????籣????????????????????????????????????WT?????????????????????????????????????????
????4???????????RAID-10??????RAID-5??
????5??????е????????????????????????????15KRPM????????7.2KRPM???????????????
????2????????????
????2.1????????????
????????????????漸???????????????IOPS?????
????1?????deadline/noop??????I/O??????????????cfq???????????DB???????
????2?????xfs?????????????ext3??ext4??????????????????????????????xfs??
????3???????mount???????????noatime??nodiratime??nobarrier???????nobarrier??xfs????????е????
????2.2???????????????
????????????????趨???????????????????swap???????????????????I/O???????????????????????帺???
????1????vm.swappiness?????5-10?????????????????0??RHEL 7???????????????0????????????OOM kill????????????????SWAP?????
????2????vm.dirty_background_ratio?????5-10????vm.dirty_ratio??????????????????????????????????????μ?????????????I/Oд????????????????MySQL?е?innodb_max_dirty_pages_pct???????
????3????net.ipv4.tcp_tw_recycle??net.ipv4.tcp_tw_reuse???????1??????TIME_WAIT?????TCPЧ???
????4????????????read_ahead_kb??nr_requests????????????????????????????д????????OLTP????????????????????е????????Ч??????????????????????????????????????????????
????3??MySQL????????
????3.1??????汾???
????????汾??????ORACLE MySQL??????????????????????????????????
??????????????????Percona????汾?????????????????????MySQL????汾??????????????????????????????????????????????ORACLE MySQL?汾????????????????????????20%???????????????????????????????????2008?????????????
?????????????????汾??MariaDB???MariaDB?????汾???????????????????????????????ORACLE MySQL??????????????MySQL Server???????????????????????????????????????汾???????????????GTID??????????汾???????????????MySQL 5.7?????????GTID?????????????????????????????????????????????汾??????????????MariaDB??
????3.2????????????????????????
??????????????漸????????????y???????????????????my.cnf???????????????????壩??
????1?????Percona??MariaDB?汾???????????????thread pool??????????????????????£??????????????????????????extra_port?????????????????????????????????????????????QUERY_RESPONSE_TIME???????????????????SQL?????????????????
????2??????default-storage-engine=InnoDB???????????InnoDB???棬?????鯔??????MyISAM???????InnoDB???????????99%????????????
????3??????innodb_buffer_pool_size??С?????????????????????InnoDB???????????????????????????50%~70%?????
????4????????????????innodb_flush_log_at_trx_commit??sync_binlog??????????????????????????????????1???????????????????????????2??10??????????????care???????????????????slave?????????????????Σ??????????0?????????????????????????????????????????????С???????????????????????????????????
????5??????innodb_file_per_table=1??????????????????????????ù????????????????
????6??????innodb_data_file_path=ibdata1:1G:autoextend????????????10M?????????и??????????????????С?????
????7??????innodb_log_file_size=256M??????innodb_log_files_in_group=2????????????90%??????????
????8??????long_query_time=1??????5.5?汾?????????????????С??1????????????0.05??50???????????Щ??н?????SQL????????????????飻
????9????????????????????????max_connection??????????????max_connection_error????????????????????10?????????open_files_limit??innodb_open_files??table_open_cache??table_definition_cache???????????????10????max_connection???С??