控制InnoDB LRU链表的两个参数——innodb_old_blocks_time和innodb_old_blocks_pct

innodb_old_blocks_timeinnodb_old_blocks_pct

innodb_old_blocks_pct:

    1)全局、动态变量,默认值 37,取值范围为5~95。
    2)Specifies the approximate percentage of the InnoDB buffer pool used for the old block sublist

innodb_old_blocks_time:

    1)全局、动态变量,默认值 1000,取值范围为0~2**32-1,单位ms。
    2)Specifies how long in milliseconds a block inserted into the old sublist must stay there after its first access before it can be moved to the new sublist.
         If the value is 0, a block inserted into the old sublist moves immediately to the new sublist the first time it is accessed, no matter how soon after insertion the access occurs.
         If the value is greater than 0, blocks remain in the old sublist until an access occurs at least that many milliseconds after the first access. 
         For example, a value of 1000 causes blocks to stay in the old sublist for 1 second after the first access before they become eligible to move to the new sublist.

innodb_old_blocks_pct用来确定LRU链表中old sublist所占比例
innodb_old_blocks_time用来控制old sublist中page的转移策略,新的page页在进入LRU链表中时,会先插入到old sublist的头部,然后page需要在old sublist中停留innodb_old_blocks_time这么久后,下一次对该page的访问才会使其移动到new sublist的头部,
该参数的设置可以保护new sublist,尽可能的防止其being filled by page that is referenced only for a brief period。

标签:InnoDB 发布于:2019-10-16 07:59:02