0
votes

Ive got mysql 5.7 cloud instance in europe-west1 zone with 1vCPU and 4Gb RAM without redundancy enabled. my db always wasnt above 30Gb, but suddenly became about 11TB. I logged to instance and notify that DB size only 15,8Gb.space usage graph

can somebody explain what happened and how i can reduce space using, which costs me 70$/day?

db size

1
Usually, this happens after you enable the bin logs of your Cloud SQL instance. Did you enabled this on the past few days? You can see the size of your binary logs by running the comand SHOW BINARY LOGS; in your Cloud SQL instance - Chris32
seems binlog consume only 6-7Gb mysql-bin.001545 6109826717 mysql-bin.001546 104857714 mysql-bin.001547 100081882 - Dmitry Semichev

1 Answers

0
votes

If you don't see an abnormal increment of binary logs while running the command SHOW BINARY LOGS; try to check the size of temporary tablespace by running the following command:

SELECT FILE_NAME, TABLESPACE_NAME, ENGINE, INITIAL_SIZE, TOTAL_EXTENTS*EXTENT_SIZE
       AS TotalSizeBytes, DATA_FREE, MAXIMUM_SIZE FROM INFORMATION_SCHEMA.FILES
       WHERE TABLESPACE_NAME = 'innodb_temporary'\G

You can also try to check the size of the general logs if you enabled them by running:

SELECT ROUND(SUM(LENGTH(argument)/POW(1024,2),2) AS GB from mysql.general_log;

If you want to solve this issue quickly to avoid more charges you can try to restart your instance (if temporal logs are filling your disk this will delete them) and export your database to a new instance with a smaller disk and then delete your old instance.

You can also try to contact Google Cloud support if you need further help with your Cloud SQL instance