Aakash
Aakash

Reputation: 3171

RDS Database storage runs out of space

I just upgraded my RDS Storage from 10GB to 20GB and after a couple of days RDS says Storage full again.

Running this query in MySQL workbench against the same DB says the DB size is 43MB

SELECT table_schema "database_name", 
sum( data_length + index_length ) / 1024 / 
1024 "Data Base Size in MB", 
sum( data_free )/ 1024 / 1024 "Free Space in MB" 
FROM information_schema.TABLES 
GROUP BY table_schema ;  

So is there something going on with the logs that MySQL creates or the backups etc that might fill up my storage space on the production servers.

Please help.

Upvotes: 10

Views: 11137

Answers (3)

Abhishek Lodha
Abhishek Lodha

Reputation: 747

Your System tablespace might be consuming the space.

You can check it using the query below:

select TABLESPACE_NAME,FILE_NAME,FREE_EXTENTS,TOTAL_EXTENTS,EXTENT_SIZE
from INFORMATION_SCHEMA.files 
where TABLESPACE_NAME in ('innodb_system','innodb_temporary');

Try to reboot your database. It should solve the problem.

Upvotes: 0

user980177
user980177

Reputation: 51

Its probably mysql.slow_log table which takes so much space.
You can remove slow logs by executing following sql:

CALL mysql.rds_rotate_slow_log

Upvotes: 5

Andrej
Andrej

Reputation: 7504

There are several types of logs in mysql. Look at http://dev.mysql.com/doc/refman/5.1/en/server-logs.html. But I advice to look at slow query logs. If you have a lot of slow queries your log will increase fast. Also check option --log-queries-not-using-indexes. Maybe you log all your queries without indexes.

Upvotes: 0

Related Questions