数据库
1.Flashcache参数
创建flashcache:flashcache_create -b 4k cachedev /dev/sdc /dev/sdb
指定flashcache的block大小与Percona的page大小相同。
Flashcache参数设置:
flashcache.fast_remove = 1:打开fast remove特性,关闭机器时,无需将cache中的脏块写入磁盘。
flashcache.reclaim_policy = 1:脏块刷出策略,0:FIFO,1:LRU。
flashcache.dirty_thresh_pct = 90:flashcache上每个hash set上的脏块阀值。
flashcache.cache_all = 1:cache所有内容,可以用黑名单过滤。
flashecache.write_merge = 1:打开写入合并,提升写磁盘的性能。
2.Percona参数
innodb_page_size:如果使用fusionio,4K的性能最好;使用SAS磁盘,设置为8K。如果全表扫描很多,可以设置为16K。比较小的page size,可以提升cache的命中率。
innodb_adaptive_checkpoint:如果使用fusionio,设置为3,提高刷新频率到0.1秒;使用SAS磁盘,设置为2,采用estimate方式刷新脏页。
innodb_io_capacity:根据IOPS能力设置,使用fuionio可以设置10000以上。
innodb_flush_neighbor_pages = 0:针对fusionio或者SSD,因为随机IO足够好,所以关闭此功能。
innodb_flush_method=ALL_O_DaIRECT:公版的MySQL只能将数据库文件读写设置为DirectIO,对于Percona可以将log和数据文件设置为direct方式读写。但是我不确定这个参数对于innodb_flush_log_at_trx_commit的影响。
innodb_read_io_threads = 1:设置预读线程设置为1,因为线性预读的效果并不明显,所以无需设置更大。
innodb_write_io_threads = 16:设置写线程数量为16,提升写的能力。
innodb_fast_checksum = 1:开启Fast checksum特性。
监 控
1.fusionio监控:fio-status命令
Media status: Healthy; Reserves: 100.00%, warn at 10.00%
Thresholds: write-reduced: 96.00%, read-only: 94.00%
Lifetime data volumes:
Logical bytes written : 2,664,888,862,208
Logical bytes read : 171,877,629,608,448
Physical bytes written: 27,665,550,363,560
Physical bytes read : 223,382,659,085,448
2.flashcache监控:dmsetup status
read hit percent(99)
write hit percent(51)
dirty write hit percent(44)
【编辑推荐】
【责任编辑:艾婧 TEL:(010)68476606】