所以,我使用的是 Wordpress、MySQL (8.0.16)、InnoDB。该wp_options表通常为 13 MB。问题是,它突然(至少在几天之内)变成 27 GB,然后停止增长,因为没有更多可用空间。这 27 GB 被视为数据,而不是索引。
转储和导入表会给你一个正常大小的表。条目数约为 4k,自增索引为 200k+。对表进行碎片整理ALTER TABLE wp_options ENGINE = InnoDB;会将磁盘上的表大小更改为正常,但即使在服务器重新启动后,mysql 也不这么认为。
+------------+------------+
| Table | Size in MB |
+------------+------------+
| wp_options | 26992.56 |
+------------+------------+
1 row in set (0.00 sec)
MySQL 日志不多说了:
2019-08-05T17:02:41.939945Z 1110933 [ERROR] [MY-012144] [InnoDB] posix_fallocate(): Failed to preallocate data for file ./XXX/wp_options.ibd, desired size 4194304 bytes. Operating system error number 28. Check that the disk is not full or a disk quota exceeded. Make sure the file system supports this function. Some operating system error numbers are described at http://dev.mysql.com/doc/refman/8.0/en/operating-system-error-codes.html
2019-08-05T17:02:41.941604Z 1110933 [Warning] [MY-012637] [InnoDB] 1048576 bytes should have been written. Only 774144 bytes written. Retrying for the remaining bytes.
2019-08-05T17:02:41.941639Z 1110933 [Warning] [MY-012638] [InnoDB] Retry attempts for writing partial data failed.
2019-08-05T17:02:41.941655Z 1110933 [ERROR] [MY-012639] [InnoDB] Write to file ./XXX/wp_options.ibd failed at offset 28917628928, 1048576 bytes should have been written, only 774144 were written. Operating system error number 28. Check that your OS and file system support files of this size. Check also that the disk is not full or a disk quota exceeded.
2019-08-05T17:02:41.941673Z 1110933 [ERROR] [MY-012640] [InnoDB] Error number 28 means 'No space left on device'
我的猜测是有些东西开始添加选项(一些与瞬态相关的东西,也许?)并且永远不会停止。
问题是,如何调试呢?任何帮助/提示将不胜感激。
每小时进行碎片整理的 Cron 看起来是一个非常糟糕的解决方案。
白板的微信
翻翻过去那场雪
汪汪一只猫