Data in Log Service is stored in a shard. This topic describes how to split, merge, and delete shards in the Log Service console.
Background information
- Each shard supports a write speed of up to 5 MB/s and a read speed of up to 10 MB/s.
If the read speed or write speed of a shard cannot meet your business requirements,
we recommend that you split the shard.
You can split a shard of a Logstore on the Logstore Attributes page of the Logstore.
- If the data traffic is much smaller than the maximum read speed or write speed of a shard, we recommend that you merge the shard.
Split a shard
Automatic sharding
- The data write speed exceeds the maximum write speed of the current shard for more than 5 minutes.
- The number of shards that are in the readwrite state does not exceed the specified maximum number of shards in the Logstore.
- Automatic Sharding
For example, Automatic Sharding is turned on, and the data write speed exceeds the maximum write speed of the current shard for more than 5 minutes. In this case, Log Service automatically increases the number of shards.
- Maximum Shards
If you turn on Automatic Sharding, you must configure the Maximum Shards parameter to specify the maximum number of shards that can be obtained after shards are automatically split. The maximum value is 64.
Merge shards
You can merge the shards of a Logstore. If you click Merge in the Actions column of a shard, Log Service locates the shard next to the specified shard, and merges the two shards.
Delete a shard
- Automatic deletion
You can specify a data retention period when you create a Logstore. If you specify the retention period, the shards in the Logstore and the data stored in the shards are automatically deleted when the retention period expires.
- Manual deletion
If you turn on Permanent Storage when you create a Logstore, we recommend that you delete the shards and data of the Logstore by deleting the Logstore. For more information, see Delete a Logstore.
Shard-related API operations
Action | Operation |
---|---|
Split a shard | SplitShard |
Merge shards | MergeShards |
Query shards | ListShards |