????1??????
??????????????????????????????????????????????? MySQL ???????? D ?δ??????? IP??????????Щ????????
????A ??????? I/O ??????????????????? 15 ?????????Σ?innodbBuffPoolPagesFlushed ????????????????????????? I/O ??????????? until ?? ????????飬??????????????????洢?????????????????? crontab ???????????λ? InnoDB ????л??????????????????????????д????????????????

????????????????????????? 24 ?????????????μ?????
??????? Query Cache??
???????? InnoDB Log ??С? 1280M??
???????? innodb_max_dirty_pages_pct ? 30??innodb_io_capacity ???? 200 ????
??????????????????I/O ???????????????????????
???????????????A ?????????????????? SSD ??????????????????????? 24 ???? 27 ????????????????????μ????? 39 ?????? SSD ??? MySQL InnoDB ????????????????????л???????ζ???? SSD ??? MySQL InnoDB ????????????????????????????????????? I/O ????
????2??SSD ????
?????????????SSD ??????????????? SAS ???SSD ???? I/O ?????????????????????????????????????????????????????????????????棬????????????? NoSQL ??????????棬????????????????????е???????????????????????????????????????????????棬????????????????????????滯??????? InnoDB ?洢???治?????????????????? MySQL ?汾????? SSD ???????????????棬???????? SSD??
????SSD ???????????????????????????Щ?????
??????????????????????????????????????? SAS ??????
???????????????????????????д??????д?????????????
????erase-before-write ????????д???????д????????
????д???????????? Wear Leveling ????????????????????????????
????????д?? I/O ????????????????????д????????????????д?? I/O ??????????С??
????????д?????д?????????? 1M ???д?? 128 ?? 8K ???漴д??ú??????漴д????????????????
??????????????????????????????????????????д????????д??????????д???????????λ?ò?????????????????????
????3?????? SSD ??????????
???????? SSD ????????????????????????????飺
???????????λ????????д???????? InnoDB ?? Redo Log????? Redo Log ?????? ib_logfile0/1/2???????????????д???????л?????????????λ????????д??
???????????д?????? Append ????????д?????????????????
??????????д???????
?????????????????????????μ?????
????????? I/O ??????? NOOP??
??????????????????С? 1280M?????? innodb_log_file_size????
?????????????? innodb_io_capacity ?? innodb_max_dirty_pages_pct ???????? I/O ????????
??????? innodb_adaptive_flushing????Ч????
??????? innodb_write_io_threads ?? innodb_read_io_threads??
????????? I/O ???????????????????? I/O ?????????????CFQ(Complete Fairness Queueing??????????? I/O ???????)??NOOP(No Operation??????????????)??Deadline????????????????AS(Anticipatory????? I/O ???????)??
????????????????????????????????
????CFQ ????????/?????????????????????????y????????????????????????????????У?????????????????????????????????????????????????????? I/O ?????I/O ???????????????????? 4 ??????
????NOOP ???????????? FIFO ???У????????????????????? I/O ????????????????????μ????????????????????????????????????????????????????
????Deadline ????????????????????????????????????????????????????????д??????????????д???????????????????????????
????AS ???????? Deadline ????????????ζ??????????? 6ms????????????ж????? I/O ??????е???????????ó????????????μ???????????????????У??????Щд??????????????????? 6ms ?в????μ? I/O ???????????ЩСд??????????????д????????д???????????д??????????
?????? SSD ???? Fusion IO?????? NOOP ????????????????????????????????????????????????????????????????ν?????????? I/O ???????????
?????????????????????????? SSD ??????? I/O ???????????? I/O ??????????? IOPS??

??????????????????????NOOP ???????????????
??????????????????????? InnoDB ????????壺
????innodb_log_file_size??InnoDB ?????????С??
????innodb_io_capacity??????????μ????????????????????
????innodb_max_dirty_pages_pct???????? Dirty Page ?? Buffer Pool ???????????
????innodb_adaptive_flushing???????????????
????innodb_write_io_threads??InnoDB ??ú???????????????д I/O?????????????????
????innodb_read_io_threads??InnoDB ??ú???????????????? I/O??????????????????
????4??A ??? MySQL ???????
????A ??? MySQL ????????????

?????? A ??? MySQL ???????
????5???????л???????
?????????л?????39 ??? 24 ???????? IO ???????????μ???????????????????仯??????????????μ????????????? 30 ?????????
????5.1 ????? IO ??????
?????????? I/O ?????? ?? CFQ???????????????????????????????????3???
????????????????£????????????????????????????????????????д?????????? sda??
????echo "noop" > /sys/block/sda/queue/scheduler
???????????Ч????????? /etc/grub.conf????? elevator????????£?
????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
???????????????????? 39 I/O ???????????????仯??
????5.2 ??? innodb_io_capacity = 4000
???????????????????????????????????? MySQL ???????
????innodb_buffer_pool_size 42949672960
????innodb_log_file_size 1342177280
????innodb_io_capacity 200
????innodb_max_dirty_pages_pct 30
????innodb_adaptive_flushing ON
????innodb_write_io_threads 4
????innodb_read_io_threads 4
?????????????£?
????SET GLOBAL innodb_io_capacity = 4000;
??????????????£???? SSD ???????MySQL ????????? innodb_io_capacity ????? 4000???????????????????????? UPDATE ?????ε??????????? 20K?????????????????д??innodb_io_capacity ?? 4000??SSD ????и?????????????????????????????????? IO ???????until ?????? 80% ?????
????5.3 ??? innodb_max_dirty_pages_pct = 25
?????????????£?
????SET GLOBAL innodb_max_dirty_pages_pct = 25;
??????????? MySQL ?????
????innodb_buffer_pool_size 42949672960
????innodb_log_file_size 1342177280
????innodb_io_capacity 4000
????innodb_max_dirty_pages_pct 25
????innodb_adaptive_flushing ON
????innodb_write_io_threads 4
????innodb_read_io_threads 4
??????????? innodb_max_dirty_pages_pct ????? 30??????? innodb_max_dirty_pages_pct ?μ?? 25%???????????????? I/O ??????????????I/O ?????????innodbBuffPoolPagesFlushed ????????????????????? 39 ?? 24 ?????????????л???????????????????????????????????????????????Ч????
????5.4 ??? innodb_io_capacity = 2000
?????????????????
??????????? MySQL ?????
????innodb_buffer_pool_size 42949672960
????innodb_log_file_size 1342177280
????innodb_io_capacity 2000
????innodb_max_dirty_pages_pct 25
????innodb_adaptive_flushing ON
????innodb_write_io_threads 4
????innodb_read_io_threads 4
??????? innodb_io_capacity ? 4000 ??????£?I/O ????????????? innodb_io_capacity ????? 2000????????w/s ????? 2000 ????????? I/O until ???????????????? 70%?????????????????I/O ?????????С??innodbBuffPoolPagesFlushed ???????
????5.5 ??? innodb_io_capacity = 1500
?????????????????
??????????? MySQL ?????
????innodb_buffer_pool_size 42949672960
????innodb_log_file_size 1342177280
????innodb_io_capacity 1500
????innodb_max_dirty_pages_pct 25
????innodb_adaptive_flushing ON
????innodb_write_io_threads 4
????innodb_read_io_threads 4
????I/O ????????????????????????μ? innodb_io_capacity??????? 1500??I/O until ?????I/O ?????????????С??innodbBuffPoolPagesFlushed ???????