Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
- The size of database shown in Home > Domains > example.com > View More Statistics is significantly different from the size shown in Home > Domains > example. com > Databases tab > example_db
- The MySQL or MariaDB database uses the InnoDB engine
Cause
The cause is MySQL bug #1341 or MariaDB bug MDEV-14795 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
As a workaround, you need to optimize the MySQL database tables or optimize the MariaDB database tables manually, so that the unused space can be reclaimed.
Warning: During the optimization, the database will be inaccessible.
If the following gets confirmed to achieve a significant improvement consistently, it may be shared as public information:
Database table optimization can also be done via phpMyAdmin by following these steps:
1. Log into Plesk
2. Go to Domains > example.com > Databases > press on phpMyAdmin for the database name
3. Mark the Check all box and select the Optimize table option from the dropdown.
The output would be similar to the following:
4. Go to Plesk > Domains > example.com > Subscription info section in the right sidebar > View More Statistics
5. Press Refresh usage stats in order to update the information that is displayed
Comments
0 comments
Please sign in to leave a comment.