All Products
Search
Document Center

Simple Log Service:Manage shards

Last Updated:Mar 01, 2026

Shards control the read and write capacity of logstores, eventstores, and metricstores in Simple Log Service (SLS). Split shards to scale up throughput, or merge them to reduce costs when traffic drops.

Key concepts

Shard range

Each shard covers a left-closed, right-open MD5 hash range [BeginKey, EndKey). All shard ranges together span the full MD5 space [00000000000000000000000000000000, ffffffffffffffffffffffffffffffff) without overlap.

When you create a logstore or MetricStore and specify the number of shards, SLS divides this range equally. For example, four shards produce the following layout:

Shard IDRange
Shard 0[00000000000000000000000000000000, 40000000000000000000000000000000)
Shard 1[40000000000000000000000000000000, 80000000000000000000000000000000)
Shard 2[80000000000000000000000000000000, c0000000000000000000000000000000)
Shard 3[c0000000000000000000000000000000, ffffffffffffffffffffffffffffffff)

Read and write capacity

Each shard provides the following throughput:

DirectionThroughputRequests
Write5 MB/s500/s
Read10 MB/s100/s

These are not hard limits. If exceeded, SLS serves on a best-effort basis without quality guarantees.

Important

If data write API calls continuously return 403 or 500 errors, check the traffic metrics and status codes for the logstore in Cloud Monitor to determine whether to add shards.

Shard status

A shard is either readwrite or readonly:

  • New shards start as readwrite.

  • After a split or merge, original shards become readonly and new shards are created as readwrite.

  • readonly shards still support reads but no longer accept writes. Status does not affect read performance.

Data write modes

SLS supports two write modes:

  • Load balancing — Each data packet is randomly assigned to an available shard. Use this mode when write traffic exceeds single-shard capacity.

  • Hash key routing — Specify an MD5 hash key. SLS writes data to the shard whose range contains that key. For example, key 5F routes to Shard 1, and key 8C routes to Shard 2 based on the range table above.

To read data, specify the target shard ID.

Split a shard

Split a shard when traffic approaches or exceeds shard capacity. Splitting divides one readwrite shard into two new readwrite shards. The original shard becomes readonly, and the two new shards together cover the same MD5 range as the original. The new shards are arranged after the original shard.

Note

If data write API calls continuously return 403 or 500 errors, check the traffic metrics and status codes for the logstore in Cloud Monitor to determine whether to add shards.

Procedure

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the one you want.

    image

  3. Click the Log Storage icon. In the Logstores list, hover over the target logstore and choose Modify from the menu.

  4. On the Logstore Attributes page, click Shard Management.

  5. Find the target shard and click Split.

    Important

    Only readwrite shards can be split.

  6. Select the number of new shards and click OK.

Merge shards

Merge shards when traffic is well below shard capacity to reduce active shard count and lower costs. Merging combines two adjacent readwrite shards into one new readwrite shard. Both original shards become readonly, and the new shard covers their combined MD5 range. The new shard is arranged after the original shards.

Shards can only be merged manually. Automatic merging is not supported.

Important

The specified shard must be readwrite and cannot be the last readwrite shard. SLS automatically selects the adjacent shard to its right for the merge.

Procedure

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the target project.

  3. Click the Log Storage icon. In the Logstores list, hover over the target logstore and choose Modify from the menu.

  4. On the Logstore Attributes page, click Shard Management.

  5. Find the target shard and click Merge.

Automatic shard splitting

Enable automatic shard splitting to handle unexpected traffic spikes without manual intervention. SLS splits a shard automatically when all of the following conditions are met:

  • Automatic Sharding is enabled for the logstore.

  • The shard write throughput exceeds its capacity for more than 5 minutes.

  • The total number of readwrite shards does not exceed the configured maximum.

Note

Shards created by a split within the last 15 minutes are not eligible for automatic splitting.

Configure automatic splitting when creating or modifying a logstore:

SettingDescription
Auto Split ShardEnable or disable automatic shard splitting.
Maximum ShardsUpper limit for readwrite shards after automatic splitting. Maximum allowed value: 256.

SLS evaluates each shard independently. Only shards meeting all conditions are split, and the total count never exceeds the configured maximum.

View shards

  1. Log on to the Simple Log Service console.

  2. In the Projects section, click the one you want.

    image

  3. Click the Log Storage icon. In the Logstores list, hover over the target logstore and choose Modify from the menu.

  4. On the Shard Management page, view the shard list for the logstore.

Delete a shard

Warning

Deleted shards cannot be restored.

  • Automatic deletion — If a data retention period is configured, shards and their data are deleted after the retention period ends.

  • Manual deletion — If permanent storage is enabled, delete the logstore to remove all shards and data. See Stop billing or delete a logstore.

API reference

ActionAPI
Split a shardSplitShard
Merge shardsMergeShard
List shardsListShards