其他分享
首页 > 其他分享> > 14.6.3.6 Configuring InnoDB Buffer Pool Flushing

14.6.3.6 Configuring InnoDB Buffer Pool Flushing

作者:互联网

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 by innodb_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 exceeds innodb_max_dirty_pages_pct, InnoDB begins to aggressively flush buffer pool pages.
当缓冲池中脏页的百分比达到innodb_max_dirty_pages_pct_lwm定义的低水位设置时,InnoDB开始刷新缓冲池页。此选项用来控制缓冲池中脏页的比例,并理想地防止脏页达到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使用算法根据重做日志生成的速度和当前刷新率来估计所需的刷新率,其目的是通过确保缓冲区刷新活动与保持缓冲池“clean”的需要相一致来平滑整体性能。自动调整刷新速率有助于避免吞吐量突然下降,因为过多的缓冲池刷新限制了普通读写活动可用的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 ifinnodb_max_dirty_pages_pct is not reached.
InnoDB以循环方式使用其日志文件。 在重用日志文件的一部分之前,InnoDB会将所有脏缓冲池页面刷新到磁盘上,其重做条目包含在日志文件的该部分中,这个过程称为sharp checkpoint。如果工作负载是写入密集型的,它会生成很多重做信息,这些信息都写入日志文件,如果日志文件中的所有可用空间都用完,则会出现sharp checkpoint,导致吞吐量暂时下降。 即使没有达到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使用启发式算法来避免这种情况,通过测量缓冲池中脏页的数量和生成重做的速率。 根据这些数字,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_flushingconfiguration 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 SUPER privilege.
由于自适应刷新可以显着影响工作负载的 I/O模式,因此可以使用innodb_adaptive_flushing配置参数关闭此功能,innodb_adaptive_flushing的默认值为ON,启用自适应刷新算法。您可以在MySQL选项文件(my.cnf或my.ini)中设置此参数的值,或者使用需要SUPER特权的SET GLOBAL命令动态更改它。
For information about fine-tuning InnoDB buffer pool flushing behavior, see Section 14.6.3.7, “Fine-tuning InnoDB Buffer Pool Flushing”.
有关微调InnoDB缓冲池刷新行为的信息,请看 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”.
有关InnoDB I/O性能的更多信息,请看 Section 8.5.8, “Optimizing InnoDB Disk I/O”.

PREV: 14.6.3.5 Configuring InnoDB Buffer Pool Prefetchin https://blog.51cto.com/itzhoujun/2355880

标签:14.6,Configuring,Buffer,buffer,InnoDB,dirty,flushing,pages,pool
来源: https://blog.51cto.com/itzhoujun/2355882