All Products
Search
Document Center

ApsaraDB for Redis:Disable AOF persistence

Last Updated:Apr 22, 2024

By default, append-only file (AOF) persistence is enabled for ApsaraDB for Redis. This topic describes how to configure the appendonly parameter to enable or disable AOF persistence.

Overview

ApsaraDB for Redis provides two data persistence options: AOF persistence and Redis database (RDB) persistence. AOF persistence logs all write operations received by the server, such as SET. These operations can then be replayed again at server startup to reconstruct the original dataset. If an AOF is larger than required, open source Redis starts an AOF rewrite process to reorganize the AOF. This reduces the disk usage of the AOF.

The AOF persistence policy for ApsaraDB for Redis instances is AOF_FSYNC_EVERYSEC. The policy specifies that the system records all write commands in an AOF every second and saves the AOF to disks. This process is also referred to as AOF flushing. The policy has little impact on the performance of Redis and can minimize data loss in various unexpected conditions. ApsaraDB for Redis supports AOF incremental archiving, which prevents performance degradation caused by AOF rewrite.

AOF flushing generates some write performance overhead. If your ApsaraDB for Redis instance is used only for caching purposes and you have no requirements for data persistence, you can perform the operations described in this topic to configure the appendonly parameter to disable AOF persistence for the instance.

Status and impacts of AOF flushing

  • By default, AOF flushing is enabled for an ApsaraDB for Redis instance.

  • If you set the appendonly parameter to no, take note of the following impacts:

    • The system disables AOF flushing without the need to restart the instance.

    • After AOF flushing is disabled, AOFs cannot be used to restore data.

    • Existing AOF logs remain unaffected.

    • For a standard instance, AOF flushing is disabled for the master node, and the replica node is unaffected.

    • For a cluster instance, AOF flushing is disabled for the master nodes of all data shards, and the replica nodes are unaffected.

    • For a read/write splitting instance, AOF flushing is disabled for the master node and all read replicas, and the replica node is unaffected.

  • If you change the value of appendonly to yes, the system enables AOF flushing without the need to restart the instance.

Procedure

  1. Log on to the ApsaraDB for Redis console and go to the Instances page. In the top navigation bar, select the region in which the instance that you want to manage resides. Then, find the instance and click the instance ID.

  2. In the left-side navigation pane, click System Parameters.

  3. On the System Parameters page, click Modify in the Actions column corresponding to the appendonly parameter.
  4. In the dialog box that appears, perform the following steps:
    1. Set the appendonly parameter.
      Valid values:
      • yes: enables AOF persistence.
      • no: disables AOF persistence.
    2. Click OK.

Related API operations

API operation

Description

DescribeParameters

Queries the configuration and operational parameters of an ApsaraDB for Redis instance.

ModifyInstanceConfig

Modifies the parameter settings of an ApsaraDB for Redis instance.