InnoDB: Warning: difficult to find free blocks in

来源:互联网 发布:安特托孔波数据 编辑:程序博客网 时间:2024/06/03 21:34

从昨天开始错误日志剧增,查看一下报的都是这个错:果断查看my.cnf 果真 innodb_buffer_pool_size=20M

看了一下内存16G。。。。16G*80%=12G   因为是db专用服务器所以,可以把这个参数值设置的最大为12G,

于是设置 : innodb_buffer_pool_size=1024M  第一次没设置那么大。

然后重启数据库,报错消失。

131121  8:11:30  InnoDB: Warning: difficult to find free blocks in

InnoDB: the buffer pool (83639 search iterations)! Consider
InnoDB: increasing the buffer pool size.
InnoDB: It is also possible that in your Unix version
InnoDB: fsync is very slow, or completely frozen inside
InnoDB: the OS kernel. Then upgrading to a newer version
InnoDB: of your operating system may help. Look at the
InnoDB: number of fsyncs in diagnostic info below.
InnoDB: Pending flushes (fsync) log: 0; buffer pool: 0
InnoDB: 2145773983 OS file reads, 1169418963 OS file writes, 150424420 OS fsyncs
InnoDB: Starting InnoDB Monitor to print further
InnoDB: diagnostics to the standard output.
131121  8:11:30  InnoDB: Warning: difficult to find free blocks in
InnoDB: the buffer pool (83657 search iterations)! Consider
InnoDB: increasing the buffer pool size.
InnoDB: It is also possible that in your Unix version
InnoDB: fsync is very slow, or completely frozen inside
InnoDB: the OS kernel. Then upgrading to a newer version
InnoDB: of your operating system may help. Look at the
InnoDB: number of fsyncs in diagnostic info below.
InnoDB: Pending flushes (fsync) log: 0; buffer pool: 0
InnoDB: 2145773983 OS file reads, 1169418963 OS file writes, 150424420 OS fsyncs
InnoDB: Starting InnoDB Monitor to print further

InnoDB: diagnostics to the standard output.

下面是具体的原因:

InnoDB: Warning: difficult to find free blocks from the buffer pool (xxxxx search iterations)! 这个错误产生的原因是mysql的InnoDB引擎的一个参数innodb_buffer_pool_size,它的值过小引起(默认8M,mysql版本:5.1.3-alpha-max)。

innodb_buffer_pool_size参数对InnoDb来说很重要,它是个缓存区,用来缓存表的数据和索引键,对InnoDb的性能影响很大,它的大小决定了InnoDb的吞吐量。官方建议它的大小设为物理内存的80%(如果该服务器为MYSQL专用服务器),但考虑到服务器上还有其他应用在跑,并且InnoDb类型的表不多,大多为Myisam引擎,我把my.cnf文件中该参数的值调为了512M(物理内存4G),然后重启mysqld服务器。InnoDB: Warning: difficult to find free blocks from the buffer pool (xxxxx search iterations)! 错误消失。



原创粉丝点击