GreatSQL社区

搜索

[待回复] 如何判断mysql的innodb buffer pool内存不够用,需要扩大这个?

523 5 2023-12-11 12:09
最近碰到数据库性能问题,去看日志提示:


[Warning] InnoDB: Difficult to find free blocks in the buffer pool (339 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. 257160371 OS file reads, 26498491 OS file writes, 2094366 OS fsyncs. Starting InnoDB Monitor to print further diagnostics to the standard output.

发现 buffer pool内存不够用 了,调大了内存问题解决,但是如何通过监控或者什么参数可以判断buffer pool内存不够用,需要调大呢 ?


全部回复(5)
yejr 2023-12-11 12:23:21
可以关注几个状况,符合一个或多个现象的话,基本上就是要加大ibp了。

1. Innodb_buffer_pool_wait_free > 0,参考 https://greatsql.cn/docs/8032/us ... #_2-2-ibp-wait-free

2. 当前脏页比例很大。

3. 当前刷脏很频繁,且可能在日志中频繁报告类似下面的log
```
[Note] [MY-011953] [InnoDB] Page cleaner took 7929ms to flush 76457 pages
```

4. 当前系统负载较高,且行锁等待严重

5. 当前系统负载较高,且磁盘I/O压力较大
chongzh 2023-12-11 14:29:57
可以参考下 :https://greatsql.cn/blog-748-1397.html  

InnoDB缓冲区缓存的命中率

公式:100 * (1 - (innodb_buffer_pool_reads/innodb_buffer_pool_read_requests ))
喜欢就关注我公众号:DBA烂笔头
忆雨林枫 2023-12-11 16:34:00
脏页和总量  计算出百分比, 这种仅推荐到监控展示, 不能作为系统内存需求评估。
因为 要考虑峰值问题,插针。
放大说, 要结合是tp还是ap, 数据量,硬件,还有关键性的SQL。
yejr 2023-12-11 17:47:38
chongzh 发表于 2023-12-11 14:29
可以参考下 :https://greatsql.cn/blog-748-1397.html  

InnoDB缓冲区缓存的命中率

这个算法有一种情况不准确,那就是当有大量全新数据请求时。
如果是一个稳定运行的系统用这个算法倒还可以。
fander 2023-12-20 09:45:59
看缓冲池命中率,一般的系统可以做到99%。太低就要扩容内存了。
fengzhencai

4

主题

0

博客

10

贡献

新手上路

Rank: 1

积分
16

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-5-8 09:19 , Processed in 0.022210 second(s), 16 queries , Redis On.
快速回复 返回顶部 返回列表