This topic describes how to set the appendonly parameter to disable AOF persistence. You can also set this parameter again to enable AOF. By default, append-only file (AOF) persistence is enabled for ApsaraDB for Redis.

Overview

ApsaraDB for Redis provides data persistence options: AOF persistence and Redis Database (RDB) persistence. AOF persistence logs every write operation received by the server, such as SET. After you restart ApsaraDB for Redis, the service runs the operations logged in the AOF files to restore data. If the files become too big, ApsaraDB for Redis can rewrite the files to optimize storage usage in the background.

AOF persistence follows the AOF_FSYNC_EVERYSEC policy of fsync every second write performances. The system records the received write commands to AOF every second. The policy has the least effect on the performance and can minimize data loss caused by user errors or a power outage. ApsaraDB for Redis can archive incremental AOF files, ensuring service performance when ApsaraDB for Redis rewrites the logs.

AOF persistence may affect the write performance. If an ApsaraDB for Redis instance is used in a cache-only scenario, you can follow the steps in this topic to set the appendonly parameter to disable AOF persistence for the instance.

Status and impacts of AOF persistence

  • By default, AOF is enabled for an ApsaraDB for Redis instance.
  • If you set the value of appendonly to no:
    • The system disables AOF persistence without restarting the instance.
    • After AOF persistence is disabled, you can no longer use the AOF files to restore data .
    • The existing AOF logs remain unchanged.
    • For a standard instance, AOF persistence is disabled for the master. The replica is not affected.
    • For a cluster instance, AOF persistence is disabled for masters of all shards. Replicas are not affected.
    • For a read/write splitting instance, AOF persistence is disabled for the master and all read replicas. The replica servers as a backup for the master is not affected.
  • If you change the value of appendonly to yes: The system enables AOF persistence without restarting the instance.

Disable AOF persistence in the console

  1. Log on to the ApsaraDB for Redis console.
  2. In the top navigation bar, select the region where the instance is deployed.
  3. On the Instances page, click Instance ID, or click the More icon and select Manage in the Actions column.
  4. On the Instance Information page, click System Parameters in the left-side navigation pane.
  5. On the System Parameters page, click Modify in the Actions column for the appendonly parameter.
  6. In the dialog box that appears, proceed with the following steps:
    Warning After you disable AOF persistence, you can no longer use AOF files to restore data. You can only use RDB files to restore data. Proceed with caution.
    1. Set the appendonly parameter.
      Valid values:
      • yes: enables AOF persistence.
      • no: disables AOF persistence.
    2. Click OK.

Call API operations to set parameters

You can also call the ModifyInstanceConfig operation to set parameters.