Plesk
kb: how-to
ABT: Group B
Problem
- The size of database shown in Home > Domains > example.com > View More Statistics different from Home > Domains > example. com > Databases tab > example_db
- The MySQL/MariaDB database uses InnoDB engine
Cause
The cause is MySQL bug #1341 in which the ibdata (ibd) files grows as it keeps the information about data even after it was deleted from the database.
The difference in file size is expected for MySQL and MariaDB databases using InnoDB storage engine, because the size in Databases tab is taken from the information_schema
table, which is the real size of the database itself and View More Statistics shows the actual size of the /var/lib/mysql/example_db/
directory in the file system:
# du -sh /var/lib/mysql/example_db/
269M /var/lib/mysql/example_db/
Resolution
Warning: During the optimization of following the database will not be accessible.
As a workaround optimize the MySQL database tables.
Comments
2 comments
Hello,
The suggested workaround for affected subscriptions is to optimize the database tables. That does appear to work. Can you suggest a good way to automate this for a subscription that seems to be frequently affected by this bug, causing them to go over quota frequently?
Best Regards,
Bob
It is also happening now:
MariaDB 10.3.34 (Ubuntu 20.04.1): https://photos.app.goo.gl/xVFhD2bvtgXvR2Qz8
Check size issue mismatch: https://photos.app.goo.gl/HKSBXvkwprphvRwR7
Check & repair database does not help: https://photos.app.goo.gl/F6ZAcDSwSWKbAqK68
Disabling binlog for affected tables can be a workaround:
https://lance.bio/2020/07/08/cleaning-up-wordpress-large-wp_options-idb/
It worked for me.
Please sign in to leave a comment.