All Products
Search
Document Center

Database Autonomy Service:Automatic shard addition

Last Updated:Aug 12, 2025

The automatic shard addition feature helps you manage Redis database instances when their data size or read/write traffic surges. This feature allows an instance to scale elastically when available memory is insufficient. It ensures that instance memory utilization remains at a safe level, which helps prevent Redis out-of-memory (OOM) risks and ensures the stability of your online business. This topic describes how to enable automatic shard addition for a Redis instance.

Prerequisites

The target database instance is a Redis Open-Source Edition cloud-native instance that uses a cluster architecture.

Scenario

If you enable automatic shard addition for a Redis database instance in Database Autonomy Service (DAS), DAS automatically adds one shard to the instance when its available memory is insufficient.

Procedure

  1. Log on to the DAS console.

  2. In the left-side navigation pane, choose Intelligent O&M Center > Instance Monitoring.

  3. On the page that appears, find the database instance that you want to manage and click the instance ID. The instance details page appears.

  4. In the navigation pane on the left of the instance details page, click Autonomy Center. In the upper-right corner of the page that appears, click Autonomy Service Settings.

  5. On the Autonomous Function Management > Autonomous Function Settings tab. Turn on the switch for the autonomy feature. On the Optimization And Throttling tab, select Automatically Add Shards and configure the following parameters.

    Parameter

    Description

    Average Memory Usage ≥

    The threshold that triggers automatic shard addition.

    Maximum Number Of Shards

    The maximum number of shards for the instance. The value must be a positive integer. Valid values: 4 to 256.

    Note

    When the total number of shards in the instance reaches the specified Maximum Number, shards are no longer automatically added.

    Observation Window

    The time range during which the performance of the database instance is observed.

    Note

    DAS periodically checks the instance. During the Observation Window, when the overall Average Memory Utilization of the instance reaches the specified threshold, DAS automatically adds a shard to the instance.

    Note

    The billing rules and the configuration change process are the same as those for manually adjusting the number of shards for a Redis instance that uses cloud disks. For more information, see Change instance configurations.

  6. Click OK.

  7. Optional: On the Event Subscription Settings tab, you can set up event notifications for automatic shard addition.

    When a suggestion for automatic shard addition is generated, DAS creates a Notice-level event. You can turn on the Enable Event Subscription switch and configure the event notification parameters. For more information, see Enable the event subscription feature.

  8. You can configure an Alert Template to subscribe to alerts. This lets you stay informed about the status of automatic shard additions for the database instance.

    The system recommends an alert template and adds alert rules for the corresponding autonomy events. You can complete the configuration as prompted.

    Note
    • If you have already configured an alert template for the instance, you can follow the prompts to add the alert rules for the corresponding autonomy events to the template.

    • To configure the alert template and alert rules manually, see Configure alert templates and Configure alert rules.

  9. Select an Alert Contact Group for notifications.

    • Click Add Contact to add a new alert contact.

    • Click Create Contact Group to add a new alert contact group.

    • Click Edit or Remove next to a contact to modify or delete the contact.

    For more information, see Manage alert contacts.

  10. Click Submit Configuration and confirm the alert configuration in the dialog box that appears.

References

To reduce the number of shards in a Redis database instance, you must perform the operation manually. For more information, see Adjust the number of shards in a cluster.