文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

Configuring InnoDB Buffer Pool

2024-04-02 19:55

关注
翻译自5.7官方文档

InnoDB performs certain tasks in the background, including flushing of dirty pages (those pages that have been changed but are not yet written to the database files) from the buffer pool.


innodb 在后台执行一些任务,包括从缓冲池刷脏页(这些页面已经被改变但是还没有写入数据库文件)


InnoDB starts flushing buffer pool pages when the percentage of dirty pages in the buffer pool reaches the low water mark setting defined byinnodb_max_dirty_pages_pct_lwm. This option is intended to control the ratio of dirty pages in the buffer pool and ideally prevent the percentage of dirty pages from reaching innodb_max_dirty_pages_pct. If the percentage of dirty pages in the buffer pool exceedsinnodb_max_dirty_pages_pct, InnoDB begins to aggressively flush buffer pool pages.


当缓冲池中的脏页百分比达到innodb_max_dirty_pages_pct_lwm设置的低水位线时,开始刷脏页。这个选项旨在控制缓冲池中的脏页比率,并且理想地组织脏页百分比达到innodb_max_dirty_pages_pct设置的值。如果缓冲池中的脏页比率超过了innodb——max_dirty_pages_pct, innodb开始积极的刷缓冲页。


InnoDB uses an algorithm to estimate the required rate of flushing, based on the speed of redo log generation and the current rate of flushing. The intent is to smooth overall performance by ensuring that buffer flush activity keeps up with the need to keep the buffer pool “clean”. Automatically adjusting the rate of flushing can help to avoid sudden dips in throughput, when excessive buffer pool flushing limits the I/O capacity available for ordinary read and write activity.


Innodb 使用算法估计需要的刷新速率,根据事务日志的生成速度和当前的刷新速率。目的是在保证缓冲池‘干净的前提下’ 尽可能的平滑整体性能。自动调整冲洗速率有助于避免过多的缓冲池冲洗限制了可用于普通读写活动的I / O容量,从而避免吞吐量突然下降。


InnoDB uses its log files in a circular fashion. Before reusing a portion of a log file, InnoDB flushes to disk all dirty buffer pool pages whose redo entries are contained in that portion of the log file, a process known as a sharp checkpoint. If a workload is write-intensive, it generates a lot of redo information, all written to the log file. If all available space in the log files is used up, a sharp checkpoint occurs, causing a temporary reduction in throughput. This situation can happen even if innodb_max_dirty_pages_pct is not reached.


innodb 用循环的方式使用日志文件。再重用这部分日志文件之前,会使用 sharp checkpoint 线程 将包含那部分redo 条目的脏缓冲页刷到磁盘上。如果程序写密集型,会产生很多的redo信息。如果日志文件的可用空间被用光了,则会出现尖锐检查点,造成吞吐量暂时降低。即使还未达到innodb_max_dirty_pages_pct,这种情况也会发生。


InnoDB uses a heuristic-based algorithm to avoid such a scenario, by measuring the number of dirty pages in the buffer pool and the rate at which redo is being generated. Based on these numbers, InnoDB decides how many dirty pages to flush from the buffer pool each second. This self-adapting algorithm is able to deal with sudden changes in workload.


InnoDB使用基于启发式的算法来避免这种情况,通过测量缓冲池中的脏页数和生成redo的速率。 根据这些数据,InnoDB决定每秒从缓冲池中刷新多少个脏页面。 这种自适应算法能够处理工作量的突然变化。


Internal benchmarking has shown that this algorithm not only maintains throughput over time, but can also improve overall throughput significantly.


内部基准测试显示,该算法不仅随着时间可以维持吞吐量,而且还能够显著提高总吞吐量。


Because adaptive flushing can significantly affect the I/O pattern of a workload, the innodb_adaptive_flushing configuration parameter lets you turn off this feature. The default value for innodb_adaptive_flushing is ON, enabling the adaptive flushing algorithm. You can set the value of this parameter in the MySQL option file (my.cnf or my.ini) or change it dynamically with the SET GLOBAL command, which requires the SUPERprivilege.


因为自适应刷新可能会显着影响工作负载的I / O模式,所以innodb_adaptive_flushing配置参数可让你关闭此功能。默认值是on,你可以再配置文件中设置该参数或者使用set global 命令动态设置,需要super权限


For information about fine-tuning InnoDB buffer pool flushing behavior, see Section 14.6.3.7, “Fine-tuning InnoDB Buffer Pool Flushing”.

For more information about InnoDB I/O performance, see Section 8.5.8, “Optimizing InnoDB Disk I/O”.

阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯