0

I have a database instance (MySQL 8) on Google Cloud and since 20 days ago, the instance's storage usage just keeps increasing (approx 2Gb every single day!). But I couldn't find out why.

What I have done:

  1. Take a look at Point-in-time recovery "Point-in-time recovery" option, it's already disabled.
  2. Binary logs is not enabled.
  3. Check the actual database size and I see my database is just only 10GB in size
  4. No innodb_per_table flag, so it must be "false" by default

The actual database size is 10GB, now the storage usage takes up to 220GB! That's a lot of money!

I couldn't resolve this issue, please give me some ideal tips. Thank you!

  • You have asked this question twice previously. You received comments requesting additional information but you did not respond or update your question. Review those comments and update your question with details to enable an answer. https://stackexchange.com/search?q=Google+Cloud+SQL+-+Database+instance+storage+size+increased+dramatically+everyday – John Hanley Dec 05 '21 at 16:39

1 Answers1

0

SQL databases get increased from multiple reasosns. It might be from unbalanced indexes and many more.

I would gamble on excessive update or even delete calls. Check if vacuum works for you (there are multiple types of vacuum - analyze, analyze full. Google it)

If it helps it means that something in the application is causing it, either it can be avoided or online periodic vacuum (or offline vaccum full with down time)

Apparently on mysql vacuum is called optimize https://dev.mysql.com/doc/refman/8.0/en/optimize-table.html

Boaz
  • 405
  • 1
  • 11
  • 16
  • The size growth happens on the instance, not in the database itself.. idk if the real problem is the database optimize – Thien Nguyen Dec 06 '21 at 02:27
  • well - you can try it :) AFAIK disk size of a database is, well, caused by the database... – Boaz Dec 06 '21 at 08:10