RDS Database storage runs out of space

邮差的信 提交于 2019-12-03 17:50:36

问题


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.


回答1:


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



回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/7210646/rds-database-storage-runs-out-of-space

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!