Reputation: 307
My available storage doesn't seem to match up with the Instance storage size in RDS.
When I run:
SELECT table_schema "database_name",
sum( data_length + index_length ) / 1024 /
1024 "Database Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;
I get:
| database_name | Data Base Size in MB | Free Space in MB |
+--------------------+----------------------+------------------+
| fx | 6787.34375000 | 3239.00000000 |
| information_schema | 0.21875000 | 0.00000000 |
| mysql | 10.04687500 | 0.00000000 |
| performance_schema | 0.00000000 | 0.00000000 |
So total available space is about 10Gb.
But the storage I have provisioned in RDS for this database instance is 29Gb (3 times more than the space I actually have).
This is after I've cleared the slow query log and general log.
Can someone clarify the discrepancy here? At the moment I'm risking running out of space.
Thanks
Upvotes: 1
Views: 2405
Reputation: 307
Turns out it was the general error log filling up - I had some batch delete jobs that could potentially run thousands of times daily, which was causing this to get big fast. Switching this off and purging it stopped the storage space continuously dropping. Hope this helps someone in future (Probably just me again).
This is also probably the best write up of options to try: https://aws.amazon.com/premiumsupport/knowledge-center/view-storage-rds-mysql-mariadb/
Upvotes: 1