All Products
Search
Document Center

ApsaraDB RDS:View and manage the size of backup files

Last Updated:Apr 25, 2024

This topic describes how to view and manage the size of backup files of an ApsaraDB RDS for MySQL instance. You can delete backup files or decrease the size of backup files to reduce backup storage costs. For more information, see Billable items and pricing for the backup storage of an ApsaraDB RDS for MySQL instance.

View the size of backup files

Total size of backup files = Size of data backup files + Size of log backup files

Note
  • You can check the Backup Usage parameter in the Usage Statistics section of the Basic Information page of your RDS instance to view the total size of backup files.

  • After you update the minor engine version of an RDS instance or a serverless RDS instance, the value of the Backup Usage parameter on the Basic Information page of the instance may be 0. After the next scheduled backup is complete, the actual value of the Backup Usage parameter is displayed.

In the following figure, the size of backup files includes 29.42 MB of data backup files and 19.57 MB of log backup files. Archive backup indicates the size of the backup files that are retained for more than 730 days. Data indicates the size of the data backup files that are not archived.备份大小

Description

Relationship between the size of backup files and the storage capacity

  • Data backup files and log backup files occupy the backup storage that is provided by Alibaba Cloud. These files do not occupy the storage capacity of your RDS instance.

  • Log files are categorized as binary log files and log backup files.

    Log

    Description

    Price

    Functionality

    Binary log files

    Binary log files refer to the raw log files that are generated on your RDS instance. Binary log files are stored on your RDS instance.

    Binary log files do not generate fees. However, binary log files consume the storage capacity of your RDS instance.

    Binary log files can be used to build the primary/secondary architecture.

    Log backup files

    After you enable the log backup feature, the system uploads the binary log files of your RDS instance to the specified backup storage. The log files that are stored in the specified backup storage are log backup files.

    For more information, see Billable items and pricing for the backup storage of an ApsaraDB RDS for MySQL instance.

    Log backup files can be used to restore data to a point in time.

    Note

Relationship between the size of backup files and the amount of data

The size of backup files may not equal the amount of data on your RDS instance.

If your RDS instance uses cloud disks, the system creates snapshots to back up your RDS instance. The size of a snapshot backup file may be significantly larger than the amount of data. The free quota on backup storage for an RDS instance that uses cloud disks is 200% of the storage capacity of the RDS instance. The free quota on backup storage for an RDS instance that uses local disks is 50% of the storage capacity of the RDS instance.

Note

When the system calculates the size of a snapshot backup file, the system counts in all the non-empty blocks to which data is written. If the write operations are scattered among blocks, none of the blocks is empty. For example, if 3 MB of data is written across two, three, or four blocks, none of these blocks is empty. In this case, the system counts in all these blocks to calculate the total size. As a result, the size of the snapshot backup file is larger than the actual amount of data.

Relationship between the size of backup files and the instance architecture

The size of backup files does not vary based on the instance architecture. For example, if an RDS instance that runs RDS High-availability Edition has the same amount of data as an RDS instance that runs RDS Basic Edition, the RDS instances have the same size of backup files. The size of backup files does not increase even if you use an RDS edition that delivers high availability.

Delete data backup files or reduce the size of data backup files

Delete data backup files

Note
  • This method can be used to delete the data backup files that are generated only from manual backups. For more information, see Manually back up an ApsaraDB RDS for MySQL instance. You can move the pointer over the image icon in the Backup Policy column to check whether the backup set is automatically generated or manually generated.

  • If the backup policy of a manual backup file is Database/Table Backup, you cannot delete the backup file. You can check whether the backup policy is Database/Table Backup in the Backup Policy column of the data backup file.

  • If you delete a manual backup file, the deleted backup file cannot be restored.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

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

  3. On the Backup and Restoration page, choose Base Backups > Data Backup.

  4. On the tab that appears, find the backup file that you want to delete, click the 1 icon, and then select Delete in the Actions column.

    image.png

Automatically delete data backup sets

Note

You can use this method to delete the backup files that are generated from manual backups and automatic backups. For more information, see Manually back up an ApsaraDB RDS for MySQL instance and Use the automatic backup feature.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.

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

  3. On the Backup and Restoration page that appears, click the Backup Strategy tab.

  4. In the Basic Backup section, click Edit to reduce the data backup retention period.

    Important

    For example, the data backup retention period of your RDS instance is 30 days.

    • If you do not upgrade the log backup feature to the point-in-time restoration (PITR) feature for your RDS instance, data backup files that are retained for more than 30 days are automatically deleted and cannot be restored. Proceed with caution.

    • If you upgrade the log backup feature to the PITR feature for your RDS instance, data backup files can be retained for more than 30 days. For more information, see Configure the PITR feature.

Reduce the size of data backup files

Method 1: Reduce the data backup frequency

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page that appears, click the Backup Strategy tab.

  4. In the Basic Backup section, click Edit to reduce the backup frequency.

Method 2: Retain the minimum number of backup sets by using the sparse backup feature

In some regions, you can use the spare backup feature by enabling the advanced backup settings on the Backup Strategy tab. The sparse backup feature allows you to configure backup policies for your RDS instance in a more flexible manner and retain the minimum number of backup sets. For more information, see Switch to the advanced backup settings and Use the sparse backup feature.

Method 3: Delete or migrate the data that does not need to be backed up

Reduce the size of log backup files or disable the log backup feature

Reduce the size of log backup files

Method 1: Shorten the log backup retention period

Note

You can specify the log backup retention period only when the log backup feature or the PITR feature is enabled. For more information about how to enable the feature, see Log backup settings.

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page that appears, click the Backup Strategy tab.

  4. In the Basic Backup section, click Edit and configure the Log Backup Retention Period (Days) or Time Range of Specific Points in Time for Restoration parameter to shorten the log backup retention period. For more information, see Configure the PITR feature.

    Important

    For example, the Log Backup Retention Period (Days) or Time Range of Specific Points in Time for Restoration parameter is set to 30 for your RDS instance.

    • If you do not upgrade the log backup feature to the PITR feature for your RDS instance and set the Log Backup Retention Period (Days) parameter to 30, data backup files that are retained for more than 30 days are automatically deleted and cannot be restored. Proceed with caution.

    • If you enable the PITR feature for your RDS instance and modify the value of the Time Range of Specific Points in Time for Restoration parameter, the retention period of log backups is also modified. If you set the value of this parameter to 30, the system retains the log backup files that are required to restore data of your RDS instance to any point in time within 30 days. This way, the overall retention period of log backup files may exceed 30 days. For more information, see Feature description.

Method 2: Retain the minimum number of backup sets by using the sparse backup feature

In some regions, you can use the spare backup feature by enabling the advanced backup settings on the Backup Strategy tab. The sparse backup feature allows you to configure backup policies for your RDS instance in a more flexible manner and retain the minimum number of backup sets. For more information, see Switch to the advanced backup settings and Use the sparse backup feature.

Method 3: Reduce unnecessary add, delete, and update operations, especially the update operations on large fields

Add, delete, and update operations increase the total size of log backup files.

Note

You can use the SQL Explorer feature to view the add, delete, update, and query operations that are performed on your RDS instance. For more information, see Use the SQL Explorer feature on an ApsaraDB RDS for MySQL instance.

Disable the log backup feature

  1. Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
  2. In the left-side navigation pane, click Backup and Restoration.

  3. On the Backup and Restoration page that appears, click the Backup Strategy tab.

  4. In the Basic Backup section, click Edit to disable the log backup feature or the PITR feature.

    Important

    After you disable the log backup feature, the system automatically deletes existing log backup files within 1 to 3 minutes. Deleted log backup files cannot be restored. Proceed with caution.

Related operations

  • You can call the DeleteBackup operation to delete the data backup files of an instance. For more information, see DeleteBackup.

  • You can call the ModifyBackupPolicy operation to modify the backup settings of an instance. For more information, see ModifyBackupPolicy.