MySQL disk space runs out quickly even though the DB itself has only 30MB of data

Alex 21 Reputation points
2022-10-05T06:51:23.19+00:00

I recently migrated from AWS RDS to Azure Database for MySQL. It's MySQL version 8 running on single server, not flexible server.

The DB instance has 100GB space allocated initially. All the DB parameters are using the default values.

However, over the past several days since migration, the disk space is quickly running out. The dashboard reports that over 48GB disk is used and it's still increasing at a speed of 7GB/day and the backup space is increasing around 20GB/day.

Other than that, I/O, memory, CPU metrics are fine. Queries, connection pools are working fine.

Since the logs are turned off by default, server log takes no space as shown in the screenshot below.
247711-2022-10-04-azure-mysql-disk-running-out-1.png

I also checked the database size, all databases themselves seems of normal size. In total there are only around 35MB data as shown below.
247672-2022-10-04-azure-mysql-disk-running-out-2.png

I didn't have any issue with AWS RDS in that regard. And since Azure MySQL is a managed DB, I can't access the OS level operations. Can someone shed any light? Thanks in advance.

Azure Database for MariaDB
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
710 questions
0 comments No comments
{count} votes

Accepted answer
  1. GeethaThatipatri-MSFT 27,012 Reputation points Microsoft Employee
    2022-10-05T18:51:19.873+00:00

    @Alex Thanks for the additional information.
    This is a known limitation in Azure Database for MySQL – Single Server. Looks like you inserted data into the database which increased the data file size. on Single Server (Gen1 storage) with no innodb_files_per_table = ON, it can happen due to bloating of system tablespace the size of the tables are not correspond with the total size of the database server. Please note that the server storage size includes:

    1. The data file (normally it is close to the size of the table, but MySQL won’t shrink file size when you delete the data. So it might be much big than the size of the table after you delete the data).
    2. Log file size (today is two 256MB files)
    3. Last 7 days binlog files. (this might be big especially if you just import a lot of data, but we will clean up the binlog older than 7 days).
    4. Size of small files such as (.frm files)

    I can think of two options

    1. Manual solution that our engineering team can do to fix by raising a support request. I can provide you with more details if you want to go with support.
    2. Use a Flexible server as a successor alternative for a Single server, you can even migrate online using DMS

    Regards
    Geetha


1 additional answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 27,012 Reputation points Microsoft Employee
    2022-10-05T16:26:40.877+00:00

    Hi @Alex Welcome to the Microsoft Q&A platform, thanks for posting the question and for using Azure Services
    Can you please share the troubleshooting tools you have access to in order to identify the cause of issues like this?
    you can check this blog on storage space on an Azure Database for MySQL flexible server and I hope it should be helpful in such scenarios.

    Please let me know if you are looking for any additional information.

    Regards
    Geetha