Skip to content

Commit c1ec72f

Browse files
authored
Merge pull request #114686 from SnehaGunda/Javav4SDK
Adding normalized request unit consumption doc
2 parents 0f39fda + 20d9e51 commit c1ec72f

File tree

7 files changed

+64
-1
lines changed

7 files changed

+64
-1
lines changed

articles/cosmos-db/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,8 @@
10801080
href: monitor-server-side-latency.md
10811081
- name: Monitor request unit usage
10821082
href: monitor-request-unit-usage.md
1083+
- name: Monitor normalized request unit usage
1084+
href: monitor-normalized-request-units.md
10831085
- name : Use Azure monitor logs
10841086
items:
10851087
- name: Monitor with diagnostic logs
119 KB
Loading
91.7 KB
Loading
140 KB
Loading
104 KB
Loading
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Monitor normalized RU/s for an Azure Cosmos container or an account
3+
description: Learn how to monitor the normalized request unit usage of an operation in Azure Cosmos DB. Owners of an Azure Cosmos DB account can understand which operations are consuming more request units.
4+
ms.service: cosmos-db
5+
ms.topic: conceptual
6+
author: kanshiG
7+
ms.author: govindk
8+
ms.date: 05/10/2020
9+
10+
---
11+
12+
# How to monitor normalized RU/s for an Azure Cosmos container or an account
13+
14+
Azure Monitor for Azure Cosmos DB provides a metrics view to monitor your account and create dashboards. The Azure Cosmos DB metrics are collected by default, this feature does not require you to enable or configure anything explicitly.
15+
16+
The **Normalized RU Consumption** metric is used to see how well saturated are the replicas wrt to the request units consumption across the partition key ranges. Azure Cosmos DB distributes the throughput equally across all the physical partitions. This metric provides a per second view of the maximum throughput utilization within a replica set. By using this metric, if you see high percentage of request units utilization, you should increase the throughput to meet the needs of your workload.
17+
18+
## What to expect and do when normalized RU/s is higher
19+
20+
When the normalized RU/s consumption reaches 100%, the client receives rate limiting errors. The client should respect the wait time and retry. If there is a short spike that reaches 100% utilization, it means that the throughput on the replica reached its maximum performance limit. For example, a single operation such as a stored procedure that consumes all the RU/s on a replica will lead to a short spike in normalized RU/s consumption. In such cases, there will not be any immediate rate limiting errors if the request rate is low. That's because, Azure Cosmos DB allows requests to charge more than the provisioned RU/s for the specific request and other requests within that time period are rate limited.
21+
22+
The Azure Monitor metrics help you to find the operations per status code by using the **Total Requests** metric. Later you can filter on these requests by the 429 status code and split them by **Operation Type**.
23+
24+
To find the requests which are rate limited, the recommended way is to get this information through diagnostic logs.
25+
26+
If there is continuous peak of 100% normalized RU/s consumption or close to 100%, it's recommended to increase the throughput. You can find out which operations are heavy and their peak usage by utilizing the Azure monitor metrics and Azure monitor logs.
27+
28+
The **Normalized RU Consumption** metric is also used to see which partition key range is more warm in terms of usage; thus giving you the skew of throughput towards a partition key range. You can later follow up to see the **PartitionKeyRUConsumption** log in Azure Monitor logs to get information about which logical partition keys are hot in terms of usage.
29+
30+
## View the normalized request unit consumption metric
31+
32+
1. Sign in to the [Azure portal](https://portal.azure.com/).
33+
34+
2. Select **Monitor** from the left-hand navigation bar, and select **Metrics**.
35+
36+
![Metrics pane in Azure Monitor](./media/monitor-normalized-request-units/monitor-metrics-blade.png)
37+
38+
3. From the **Metrics** pane > **Select a resource** > choose the required **subscription**, and **resource group**. For the **Resource type**, select **Azure Cosmos DB accounts**, choose one of your existing Azure Cosmos accounts, and select **Apply**.
39+
40+
![Choose an Azure Cosmos account to view metrics](./media/monitor-normalized-request-units/select-cosmos-db-account.png)
41+
42+
4. Next you can select a metric from the list of available metrics. You can select metrics specific to request units, storage, latency, availability, Cassandra, and others. To learn in detail about all the available metrics in this list, see the [Metrics by category](monitor-cosmos-db-reference.md) article. In this example, let’s select **Normalized RU Consumption** metric and **Max** as the aggregation value.
43+
44+
In addition to these details, you can also select the **Time range** and **Time granularity** of the metrics. At max, you can view metrics for the past 30 days. After you apply the filter, a chart is displayed based on your filter.
45+
46+
![Choose a metric from the Azure portal](./media/monitor-normalized-request-units/normalized-request-unit-usage-metric.png)
47+
48+
### Filters for normalized request unit consumption
49+
50+
You can also filter metrics and the chart displayed by a specific **CollectionName**, **DatabaseName**, **PartitionKeyRangeID**, and **Region**. To filter the metrics, select **Add filter** and choose the required property such as **CollectionName** and corresponding value you are interested in. The graph then displays the Normalized RU Consumption units consumed for the container for the selected period.
51+
52+
You can group metrics by using the **Apply splitting** option.
53+
54+
The normalized request unit consumption metric for each container are displayed as shown in the following image:
55+
56+
![Apply filters to normalized request unit consumption metric](./media/monitor-normalized-request-units/normalized-request-unit-usage-filters.png)
57+
58+
## Next steps
59+
60+
* Monitor Azure Cosmos DB data by using [diagnostic settings](cosmosdb-monitor-resource-logs.md) in Azure.
61+
* [Audit Azure Cosmos DB control plane operations](audit-control-plane-logs.md)

articles/cosmos-db/monitor-request-unit-usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Monitor the throughput usage of an operation in Azure Cosmos DB
3-
description: Learn how to monitor the throughput or request unit usage of an operation in Azure Cosmos DB. Owners of an Azure Cosmos DB account can understand which operations are taking more Request units.
3+
description: Learn how to monitor the throughput or request unit usage of an operation in Azure Cosmos DB. Owners of an Azure Cosmos DB account can understand which operations are taking more request units.
44
ms.service: cosmos-db
55
ms.topic: conceptual
66
author: kanshiG

0 commit comments

Comments
 (0)