I'm struggling to find what consuming storage on MySQL RDS instance.
We have 30Gb RDS instance
Slow and general logs are disabled;
binlogs removed immediately (better say as soon as possible)
Free Storage Space metric reports ~10Gb.
Trying to calculate used storage with next query (see output below):
SELECT table_schema, SUM(data_length + index_length + data_free)/1024/1024/1024 AS total_Gb, SUM(data_length)/1024/1024/1024 AS data_Gb, SUM(index_length)/1024/1024/1024 AS index_Gb, SUM(data_free)/1024/1024/1024 AS free_Gb, COUNT(*) AS tables FROM information_schema.tables GROUP BY table_schema ORDER BY 2 DESC;
Since the total size of the database (including free_data for this database) is 13.6Gb, I don't understand where the rest of the storage is missing (5-6Gb).
The main question is why FreeStorageSpace metric in CloudWatch shows only 10Gb free while I can see almost 15Gb free on MySQL?
| table_schema | total_Gb | data_Gb | index_Gb | free_Gb | tables |
+--------------------+-----------------+-----------------+----------------+-----------------+--------+
| information_schema | 14.156433105469 | 0.000183105469 | 0.000000000000 | 14.156250000000 | 63 |
| main_database | 13.608055360615 | 11.013053961098 | 1.915313899517 | 0.679687500000 | 373 |
| mysql | 0.018694377504 | 0.008742786013 | 0.000185966492 | 0.009765625000 | 43 |
| sys | 0.000015258789 | 0.000015258789 | 0.000000000000 | 0.000000000000 | 101 |
| performance_schema | 0.000000000000 | 0.000000000000 | 0.000000000000 | 0.000000000000 | 87 |
+--------------------+-----------------+-----------------+----------------+-----------------+--------+```
Here is allocation for information_schema tables:
| table_schema | table_name | total_Gb | data_Gb | index_Gb | free_Gb | tables |
+--------------------+---------------------------------------------------------+----------------+----------------+----------------+----------------+--------+
| information_schema | PROCESSLIST | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | EVENTS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | PLUGINS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | VIEWS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | PARTITIONS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | RDS_EVENTS_THREADS_WAITS_CURRENT | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | RDS_PROCESSLIST | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | PARAMETERS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | TRIGGERS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | COLUMNS | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | OPTIMIZER_TRACE | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |
| information_schema | ROUTINES | 1.179702758789 | 0.000015258789 | 0.000000000000 | 1.179687500000 | 1 |