[Warning] InnoDB: Difficult to Find Free Blocks in the Buffer Pool
2020-11-24 09:59 abce 阅读(2787) 评论(0) 编辑 收藏 举报MySQL错误日志给出警告信息:
1 2 3 | [Warning] InnoDB: Difficult to find free blocks in the buffer pool (336 search iterations)! 0 failed attempts to flush a page! Consider increasing the buffer pool size. It is also possible that in your Unix version fsync is very slow, or completely frozen inside the OS kernel. Then upgrading to a newer version of your operating system may help. Look at the number of fsyncs in diagnostic info below. Pending flushes (fsync) log: 0; buffer pool: 0. 1621989850 OS file reads, 1914021664 OS file writes, 110701569 OS fsyncs. Starting InnoDB Monitor to print further diagnostics to the standard output. 2019-10-26T15:02:03.962059Z 4520929 [Warning] InnoDB: Difficult to find free blocks in the buffer pool (337 search iterations)! 0 failed attempts to flush a page! Consider increasing the buffer pool size. It is also possible that in your Unix version fsync is very slow, or completely frozen inside the OS kernel. Then upgrading to a newer version of your operating system may help. Look at the number of fsyncs in diagnostic info below. Pending flushes (fsync) log: 0; buffer pool: 0. 1621989850 OS file reads, 1914021664 OS file writes, 110701569 OS fsyncs. Starting InnoDB Monitor to print further diagnostics to the standard output. |
当InnoDB中的线程不断地请求空闲块,但无法从buffer pool中获得空闲块的时候,就会出现上面的警告消息。实际中,并不是这么简单,可能还有其他事情发生,懂得如何构建buffer pool中的块,就可以轻松的明白。
buffer pool主要由三个列表组成:
2.lru list:最近最少使用列表
·从free list中寻找一个空闲的块,如果有可用就分配它。如果不是,继续。
·扫描lru列表,如果找到干净(clean)的块,就将块移动到free list中,并分配。如果没有,继续。
·从lru列表的尾部刷新脏页,将其移动到free list,并分配。
这里是简化的步骤,只是为了便于理解,实际并不是这么简单,但类似。在任何时刻,如果块被移动到free list,就可以被任何线程使用,就可能使得当前的线程无法获取到块。当前线程就会每间隔10ms执行一次请求。
那什么时候会将警告信息写入日志呢?
当一个线程执行超过20迭代,就会将警告信息写入日志。下面是对应的源码块:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | if (n_iterations > 20 & & srv_buf_pool_old_size == srv_buf_pool_size) {< strong > <= == == == Here it is < / strong > ib:: warn(ER_IB_MSG_134) \ << "Difficult to find free blocks in the buffer pool" \ " (" \ << n_iterations << " search iterations)! " << flush_failures \ << " failed attempts to" \ " flush a page! Consider increasing the buffer pool" \ " size. It is also possible that in your Unix version" \ " fsync is very slow, or completely frozen inside" \ " the OS kernel. Then upgrading to a newer version" \ " of your operating system may help. Look at the" \ " number of fsyncs in diagnostic info below." \ " Pending flushes (fsync) log: " |
·IO子系统慢,不能满足需要及时将页刷新到磁盘
·page cleaner线程数量不够
1.增加buffer pool
2.调优、升级IO子系统
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
2015-11-24 zabbix中文乱码的解决办法
2015-11-24 Oracle 12C -- 网络性能调优
2015-11-24 Oracle 12C -- ADRCI查看DDL日志