Problem description
The Binlog disk usage in the apsaradb RDS for MySQL instance is high. If the disk space is full, the instance is locked and RDS cannot perform read and write operations.
Possible cause
Binlogs occupy a large amount of instance space due to the following reasons:
- Applications have a large number of read and write requests. As a result, the RDS Database generates a large number of transaction operations and Binlog files.
- Large transactions exist in application services, resulting in many binlogs.
- Binlog occupation by a process causes clearance program exceptions, which prevents the Binlog from being cleared in a timely manner.
New solution
- Log on to the RDS console, select the region where the destination instance is located, and click the instance ID to go to the basic information page.
- In the left-side navigation pane, click backup and restoration to open the backup and restoration page.
- Select Upload Binlog to upload binlogs to OSS. After the Binlog is uploaded, delete the local Binlog.
References
The following section describes the generation mechanism and clearance rules of Binlog files.
The rules for generating binlogs in the instance.
- If the size of a binary log exceeds 500MB, the system continues writing data to the next log file. Data is written to new Binlog files. The former Binlog files are not uploaded to OSS immediately. Instead, the files are uploaded to OSS in asynchronous mode.
- If a Binlog file is not no longer written when its size reaches 500MB, this may be caused by command execution, system restart, or other reasons.
- A Binlog file exceeds 500MB in size. For example, a large transaction is being processed but Binlog files are being continuously written to the binary log file.
The rule for clearing binlogs in an instance.
- By default, the instance retains Binlog files generated in the last 18 hours.
- When the instance space is less than 70%, the system retains binlogs for 18 hours, even if the Binlog file has been uploaded to OSS.
- When the instance space is greater than 70%, binlogs will be uploaded to OSS and then the local data will be deleted. However, local deletion may delay task scheduling.
- Binlogs can be displayed in the RDS console after they are uploaded to OSS.
If the RDS instance is locked and cannot perform database read /write operations due to the full disk space, the business can be seriously affected. In this case, you can open a ticket to ask Alibaba Cloud technical support to unlock the RDS instance and resume use. Then, the customer releases the disk space by cleaning up binlogs or deleting useless historical data in the RDS console.
Application scope
- Apsaradb RDS for MySQL