Skip to content

Commit 4c6a75f

Browse files
Merge pull request #210593 from deborahc/dech-elasticity-docs-v2
Adding some guidance on how to identify merge candidate collections
2 parents 7f08a77 + f83669e commit 4c6a75f

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed
162 KB
Loading
153 KB
Loading

articles/cosmos-db/merge.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,42 @@ The Azure Cosmos DB team will review your request and contact you via email to c
2727

2828
To check whether an Azure Cosmos DB account is eligible for the preview, you can use the built-in eligibility checker in the Azure portal. From your Azure Cosmos DB account overview page in the Azure portal, navigate to **Diagnose and solve problems** -> **Throughput and Scaling** -> **Partition Merge**. Run the **Check eligibility for partition merge preview** diagnostic.
2929

30-
:::image type="content" source="media/merge/throughput-and-scaling-category.png" alt-text="Throughput and Scaling topic in Diagnose and solve issues page":::
30+
:::image type="content" source="media/merge/throughput-and-scaling-category.png" alt-text="Screenshot of Throughput and Scaling topic in Diagnose and solve issues page.":::
3131

32-
:::image type="content" source="media/merge/merge-eligibility-check.png" alt-text="Merge eligibility check with table of all preview eligibility criteria":::
32+
:::image type="content" source="media/merge/merge-eligibility-check.png" alt-text="Screenshot of merge eligibility check with table of all preview eligibility criteria.":::
33+
34+
### How to identify containers to merge
35+
36+
Containers that meet both of these conditions are likely to benefit from merging partitions:
37+
- Condition 1: The current RU/s per physical partition is <3000 RU/s
38+
- Condition 2: The current average storage in GB per physical partition is <20 GB
39+
40+
Condition 1 often occurs when you have previously scaled up the RU/s (often for a data ingestion) and now want to scale down in steady state.
41+
Condition 2 often occurs when you delete/TTL a large volume of data, leaving unused partitions.
42+
43+
#### Criteria 1
44+
45+
To determine the current RU/s per physical partition, from your Cosmos account, navigate to **Metrics**. Select the metric **Physical Partition Throughput** and filter to your database and container. Apply splitting by **PhysicalPartitionId**.
46+
47+
For containers using autoscale, this will show the max RU/s currently provisioned on each physical partition. For containers using manual throughput, this will show the manual RU/s on each physical partition.
48+
49+
In the below example, we have an autoscale container provisioned with 5000 RU/s (scales between 500 - 5000 RU/s). It has 5 physical partitions and each physical partition has 1000 RU/s.
50+
51+
:::image type="content" source="media/merge/RU-per-physical-partition-metric.png" alt-text="Screenshot of Azure Monitor metric Physical Partition Throughput in Azure portal.":::
52+
53+
#### Criteria 2
54+
55+
To determine the current average storage per physical partition, first find the overall storage (data + index) of the container.
56+
57+
Navigate to **Insights** > **Storage** > **Data & Index Usage**. The total storage is the sum of the data and index usage. In the below example, the container has a total of 74 GB of storage.
58+
59+
:::image type="content" source="media/merge/storage-per-container.png" alt-text="Screenshot of Azure Monitor storage (data + index) metric for container in Azure portal.":::
60+
61+
Next, find the total number of physical partitions. This is the distinct number of **PhysicalPartitionIds** in the **PhysicalPartitionThroughput** chart we saw in Criteria 1. In our example, we have 5 physical partitions.
62+
63+
Finally, calculate: Total storage in GB / number of physical partitions. In our example, we have an average of (74 GB / 5 physical partitions) = 14.8 GB per physical partition.
64+
65+
Based on criteria 1 and 2, our container can potentially benefit from merging partitions.
3366

3467
### Merging physical partitions
3568

0 commit comments

Comments
 (0)