MySQL neighbor flush_MySQL数据库的优化方案与实践(2)

数据库

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】

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值