Billing
If you change the number of shards for a pay-as-you-go instance, you are charged based on the new specifications after the change. In this case, no upfront payment is required. You only need to make a payment upon receiving the bill.
If you add shards to a subscription instance, you must pay for the cost of the additional shards. If you remove shards, a refund for the removed shards is automatically issued. For information about the fees and refund policy, see Configuration changes.
Impacts
-
Setting shard addition or removal to occur during the maintenance window is not supported. Once the shard adjustment operation is complete, the instance status changes to Changing Configuration.
-
The time it takes to complete configuration changes depends on factors such as network conditions, task queue length, instance payload, and data volume. Since configuration changes may cause fluctuations in response latency, it is advisable to perform them during off-peak business hours.
-
Be aware that removing shards will decrease the overall capacity and performance of the instance, and will forcibly disconnect connections on the affected shards. Exercise caution with this operation, and ensure that the application is capable of automatically reestablishing connections.
Precautions
-
The minimum number of shards for an instance is 2. You can add or remove up to 64 shards at a time, with a maximum of 256 shards per instance.
-
When adding shards, the instance automatically redistributes data. However, adding just a few shards at a time can result in slow data redistribution and reduced scale-out efficiency. It is recommended to add at least one-sixth of the current total number of shards (rounded up) to an instance at once, for example:
-
If your instance contains 8 shards, it is advisable to add at least 2 shards (since 8 divided by 6 equals 1.33, which rounds up to 2).
-
For an instance with 64 shards, adding at least 11 shards is recommended.
-
For an instance comprising 100 shards, we recommend the addition of at least 17 shards.
Procedure
Log on to the 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.
-
In the Shard Information area, select one of the following operations based on your business needs:
-
To add shards
Click Add Shard, enter the number of shards in the pop-up box, click Proceed To Payment, and follow the prompts to complete the payment.
Note
The specifications of the added shards will match those of existing shards and cannot be altered.
-
Remove shards.
Warning
Be aware that removing shards will decrease the overall capacity and performance of the instance, and will forcibly disconnect connections on the affected shards. Exercise caution with this operation, and ensure that the application is capable of automatically reestablishing connections.
-
Click Batch Delete or Delete next to the corresponding shard ID.
-
In the dialog box, choose the deletion policy for the Proxy node: Execute Immediately or Execute During Maintenance Window, which has a lower impact.
-
Click OK. The shard will be removed instantly, and its data will be automatically redistributed to other shards.
FAQ
Will data be lost if shards are removed?
No data is lost when shards are removed. The data is redistributed.
Will a refund be issued if shards are removed?
A refund is automatically processed when shards are removed. For detailed fee descriptions and refund policies, see configuration change fee description.
Will data be redistributed if the number of shards in an instance is increased or decreased?
Data is automatically analyzed and redistributed when the number of shards in an instance changes. The instance is optimized at the kernel layer for efficient data redistribution, minimizing business impact.
References
-
The Redis open source edition automatically adds shards based on the average memory utilization of the instance to ensure the safety and stability of the service. For more information, see how to automatically add shards.
-
To modify the shard count of a classic edition cluster architecture instance, see changing instance configuration.