这坑爹的遭遇一定要记录一下。
公司的项目查询数据量超大。一个查询请求,竟然把mysql搞挂了。
重启了N次wamp,都是无法启动mysql。然后不耐烦了,备好www目录,重装了wamp。
配置好域名,再次导入数据库,,,然后再次点击那个一个请求。又挂了。。。
无奈找大神问一下,查了/wamp/logs/mysql.log发现竟然4G多的记录。mysql服务也还没有停止。
mysql.log这么大都不敢打开了。再重装了一次wamp。这次先打开了mysql.log文件。再去点那个请求。
报错终于呈现了。
一段一段的相同的报错,在不停的写入。如下所示:
[Warning] InnoDB: Difficult to find free blocks in the buffer pool (21 search iterations)! 21 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. 23423 OS file reads, 8265 OS file writes, 33 OS fsyncs. Starting InnoDB Monitor to print further diagnostics to the standard output.
谷歌了一下,原来是innodb的缓冲区设置太小了,需要分配大一点的内存。
打开my.ini找到 innodb_buffer_pool_size,把这个参数设置为1024M,彻底停止mysqld服务。重启wamp。终于可以了。
打开项目,再点击那个请求。也可以了。
报错也消失了。
和 https://blog.youkuaiyun.com/wulantian/article/details/16856859