[mysql] InnoDB的主线程master thread的处理

博客首页 » mysql InnoDB的主线程master thread的处理

发布于 20 Feb 2015 14:19
标签 blog
InnoDB主线程Master Thread的处理

主要循环

Loop, 1s, 10s
Background loop
Flush loop
Suspend loop

主循环每秒处理

Flush log to disk (always)
Merge insert buffer (when io/s < 5)
100 dirty pages to disk (buf_get_modified_ratio_pct > innodb_max_dirty_pages_pct 默认90%)
do to bg loop (no user activity)

主循环每10秒处理

Flush 100 dirty pages to disk (when io/10s < 200)
Merge 5 insert buffer (always)
Flush log buffer to disk (always)
Full purge not used undo 20 pages
Flush 100 or 10 dirty pages to disk (when buf_get_modified_ratio_pct > 70, flush 100 pages, when < 70, flush 10% pages)
Generate innodb fuzzy checkpoint,write oldest LSN pages to disk

Background Loop的处理

Delete not used undo pages (always)
Merge 20 insert buffer (always)
Back to main loop (always)
Keep to flush 100 pages, until condition confirmed

突破IO限制
  • Hard Coding造成IO限制,InnoDB Plugin参数
  • innodb_io_capacity = 200
    • 机器快,读写慢,恢复慢
    • 合并插入缓冲时,5%
    • 刷新Dirty Pages时,100%
  • innodb_max_dirty_pages_pct = 90
    • 内存大,恢复慢
    • -> 75
  • innodb_adaptive_flushing
  • buf_flush_get_desired_flush_rate 通过redo log产生速度判断合适刷新dirty pages的数量。

本页面的文字允许在知识共享 署名-相同方式共享 3.0协议和GNU自由文档许可证下修改和再使用,仅有一个特殊要求,请用链接方式注明文章引用出处及作者。请协助维护作者合法权益。


系列文章

文章列表

  • mysql InnoDB的主线程master thread的处理

这篇文章对你有帮助吗,投个票吧?

rating: 0+x

留下你的评论

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License