All Products
Search
Document Center

ApsaraDB RDS:What do I do if the storage capacity of an ApsaraDB RDS for MySQL instance is exhausted by binary log files?

Last Updated:Nov 24, 2023

Problem description

My RDS instance is automatically locked because the storage capacity is exhausted by binary log files. The status of the RDS instance is displayed as Locked on the Basic Information page of the RDS instance. The Disk Space (MB) chart on the Standard Monitoring tab of the Monitoring and Alerts page shows that the log files occupy a large amount of storage. The following figure is provided only for reference.问题描述

Causes

A large number of binary log files are generated within a short period of time after you execute large transactions, and the storage capacity of your RDS instance may be exhausted. Then, your RDS instance is automatically locked to prevent data loss. In this case, you cannot write data to your RDS instance.

Solutions

Prerequisites

If your RDS instance runs MySQL 5.5, MySQL 5.6, MySQL 5.7, or MySQL 8.0, you must expand the storage capacity and make sure that the storage usage is less than or equal to 80%. For more information, see Change instance specifications.

Usage notes

Before you delete binary log files that you no longer require, take note of the following items:

  • Binary log files record transaction information about an RDS instance. Binary log files are used to ensure the high availability and recoverability of the RDS instance. We recommend that you do not disable binary logging. You can use the Upload Binlogs feature to upload binary log files to an Object Storage Service (OSS) bucket to release storage. You can also modify the retention policy of binary log files. For more information, see Delete the binary log files of an ApsaraDB RDS for MySQL instance.

  • After you delete the binary log files, a period of time is required to release the storage of your RDS instance.

  • After you click Upload Binlogs to upload binary log files, the deletion task is asynchronously submitted in the background, and the binary log files that are written are uploaded to the OSS bucket that is automatically provisioned. After the binary log files are uploaded, the binary log files are deleted from your RDS instance. You cannot delete the binary log files that are being written. After you click Upload Binlogs, we recommend that you wait for a period of time for the system to release the storage. Do not click Upload Binlogs multiple times. You can check whether the storage is released on the Basic Information page of your RDS instance.

  • Binary log files are generated within a short period of time when you perform DML operations, such as DML operations that involve large fields. The speed at which the system uploads the generated binary log files to backup storage and deletes the files from the RDS instance may not keep up with the speed at which binary log files are generated. In this case, we recommend that you expand the storage capacity and identify the causes for the rapid increase of binary log files.

Use the Upload Binlogs feature to upload binary log files

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select the region in which your RDS instance resides.

  2. Find the RDS instance and click the instance ID.

  3. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  4. Click Upload Binlogs. In the message that appears, click OK.

    Note
    • Wait for approximately 15 minutes for the upload to complete.

    • This operation deletes all log files except the two most recent binary log files. If only two log files exist, no files are deleted.

    • RDS Basic Edition does not support the Upload Binlogs feature. If your RDS instance runs RDS Basic Edition, we recommend that you delete binary log files based on the description in the Modify the retention policy of binary log files section of this topic.

    一键上传

Modify the retention policy of binary log files

  1. Log on to the ApsaraDB RDS console. In the top navigation bar, select the region in which your RDS instance resides.

  2. Find the RDS instance and click the instance ID.

  3. In the left-side navigation pane of the page that appears, click Backup and Restoration.

  4. On the Backup Settings tab, click Edit on the right of Local Log Backup Settings. In the dialog box that appears, modify the retention policy based on your business requirements.

    Note

    If the Retention Period parameter is set to 0, binary log files are not stored in your RDS instance and are directly uploaded to an OSS bucket.

    修改本地日志

What to do next

If your RDS instance is unlocked, we recommend that you enable the automatic storage expansion feature for the RDS instance. This prevents your RDS instance from being locked due to insufficient storage resources. For more information, see Configure automatic storage expansion for an ApsaraDB RDS for MySQL instance.

References

For more information about how to handle the issue that the storage capacity is exhausted, see the following topics: