You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/sql/troubleshoot-dot-net-sdk-slow-request.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: Learn how to diagnose and fix slow requests when you use Azure Cosm
4
4
author: ealsur
5
5
ms.service: cosmos-db
6
6
ms.subservice: cosmosdb-sql
7
-
ms.date: 07/08/2022
7
+
ms.date: 08/19/2022
8
8
ms.author: maquaran
9
9
ms.topic: troubleshooting
10
10
ms.reviewer: mjbrown
@@ -27,8 +27,12 @@ When you design your application, [follow the .NET SDK best practices](performan
27
27
Consider the following when developing your application:
28
28
29
29
* The application should be in the same region as your Azure Cosmos DB account.
30
-
* The SDK has several caches that have to be initialized, which might slow down the first few requests.
31
-
* The connectivity mode should be direct and TCP.
30
+
* Your [ApplicationRegion](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions.applicationregion), [ApplicationPreferredRegions](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions.applicationpreferredregions), or [PreferredLocations](/dotnet/api/microsoft.azure.documents.client.connectionpolicy.preferredlocations) for V2 SDK configuration is should reflect your regional preference and point to the region your application is deployed on.
31
+
* There might be a bottleneck on the Network interface because of high traffic. If the application is running on Azure Virtual Machines, there are possible workarounds:
32
+
* Consider using a [Virtual Machine with Accelerated Networking enabled](../../virtual-network/create-vm-accelerated-networking-powershell.md).
33
+
* Enable [Accelerated Networking on an existing Virtual Machine](../../virtual-network/create-vm-accelerated-networking-powershell.md#enable-accelerated-networking-on-existing-vms).
34
+
* Consider using a [higher end Virtual Machine](../../virtual-machines/sizes.md).
* Avoid high CPU. Make sure to look at the maximum CPU and not the average, which is the default for most logging systems. Anything above roughly 40 percent can increase the latency.
Copy file name to clipboardExpand all lines: articles/cosmos-db/sql/troubleshoot-dot-net-sdk.md
+4-39Lines changed: 4 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Diagnose and troubleshoot issues when using Azure Cosmos DB .NET SDK
3
3
description: Use features like client-side logging and other third-party tools to identify, diagnose, and troubleshoot Azure Cosmos DB issues when using .NET SDK.
4
4
author: seesharprun
5
5
ms.service: cosmos-db
6
-
ms.date: 03/05/2021
6
+
ms.date: 08/19/2022
7
7
ms.author: sidandrews
8
8
ms.reviewer: mjbrown
9
9
ms.subservice: cosmosdb-sql
@@ -63,9 +63,8 @@ If your app is deployed on [Azure Virtual Machines without a public IP address](
63
63
* Assign a [public IP to your Azure VM](../../load-balancer/troubleshoot-outbound-connection.md#configure-an-individual-public-ip-on-vm).
High network latency can be identified by using the [diagnostics string](/dotnet/api/microsoft.azure.documents.client.resourceresponsebase.requestdiagnosticsstring) in the V2 SDK or [diagnostics](/dotnet/api/microsoft.azure.cosmos.responsemessage.diagnostics#Microsoft_Azure_Cosmos_ResponseMessage_Diagnostics) in V3 SDK.
67
66
68
-
If no [timeouts](troubleshoot-dot-net-sdk-request-timeout.md) are present and the diagnostics show single requests where the high latency is evident.
67
+
High network latency can be identified by using the diagnostics.
Network interactions in the diagnostics will be for example:
80
-
81
-
```json
82
-
{
83
-
"name": "Microsoft.Azure.Documents.ServerStoreModel Transport Request",
84
-
"id": "0e026cca-15d3-4cf6-bb07-48be02e1e82e",
85
-
"component": "Transport",
86
-
"start time": "12: 58: 20: 032",
87
-
"duration in milliseconds": 1638.5957
88
-
}
89
-
```
90
-
91
-
Where the `duration in milliseconds` would show the latency.
92
-
93
78
# [V2 SDK](#tab/diagnostics-v2)
94
79
95
80
The diagnostics are available when the client is configured in [direct mode](sql-sdk-connection-modes.md), through the `RequestDiagnosticsString` property:
@@ -98,33 +83,13 @@ The diagnostics are available when the client is configured in [direct mode](sql
* Your application is not running in the same region as your Azure Cosmos DB account.
113
-
* Your [PreferredLocations](/dotnet/api/microsoft.azure.documents.client.connectionpolicy.preferredlocations) or [ApplicationRegion](/dotnet/api/microsoft.azure.cosmos.cosmosclientoptions.applicationregion) configuration is incorrect and is trying to connect to a different region to where your application is currently running on.
114
-
* There might be a bottleneck on the Network interface because of high traffic. If the application is running on Azure Virtual Machines, there are possible workarounds:
115
-
* Consider using a [Virtual Machine with Accelerated Networking enabled](../../virtual-network/create-vm-accelerated-networking-powershell.md).
116
-
* Enable [Accelerated Networking on an existing Virtual Machine](../../virtual-network/create-vm-accelerated-networking-powershell.md#enable-accelerated-networking-on-existing-vms).
117
-
* Consider using a [higher end Virtual Machine](../../virtual-machines/sizes.md).
88
+
Please see our [latency troubleshooting guide](troubleshoot-dot-net-sdk-slow-request.md) once you have obtained diagnostics for the affected operations.
118
89
119
90
### Common query issues
120
91
121
-
The [query metrics](sql-api-query-metrics.md) will help determine where the query is spending most of the time. From the query metrics, you can see how much of it is being spent on the back-end vs the client. Learn more about [troubleshooting query performance](troubleshoot-query-performance.md).
122
-
123
-
* If the back-end query returns quickly, and spends a large time on the client check the load on the machine. It's likely that there are not enough resource and the SDK is waiting for resources to be available to handle the response.
124
-
* If the back-end query is slow, try [optimizing the query](troubleshoot-query-performance.md) and looking at the current [indexing policy](../index-overview.md)
125
-
126
-
> [!NOTE]
127
-
> For improved performance, we recommend Windows 64-bit host processing. The SQL SDK includes a native ServiceInterop.dll to parse and optimize queries locally. ServiceInterop.dll is supported only on the Windows x64 platform. For Linux and other unsupported platforms where ServiceInterop.dll isn't available, an additional network call will be made to the gateway to get the optimized query.
92
+
The [query metrics](sql-api-query-metrics.md) will help determine where the query is spending most of the time. From the query metrics, you can see how much of it is being spent on the back-end vs the client. Learn more on the [query performance guide](performance-tips-query-sdk.md?pivots=programming-language-csharp).
128
93
129
94
If you encounter the following error: `Unable to load DLL 'Microsoft.Azure.Cosmos.ServiceInterop.dll' or one of its dependencies:` and are using Windows, you should upgrade to the latest Windows version.
The SDK wasn't able to connect to Azure Cosmos DB.
16
+
The SDK wasn't able to connect to Azure Cosmos DB. This scenario can be transient or permanent depending on the network conditions.
17
+
18
+
It is important to make sure the application design is following our [guide for designing resilient applications with Azure Cosmos DB SDKs](conceptual-resilient-sdk-applications.md) to make sure it correctly reacts to different network conditions. Your application should have retries in place for service unavailable errors.
19
+
20
+
When evaluating the case for service unavailable errors:
21
+
22
+
* What is the impact measured in volume of operations affected compared to the operations succeeding? Is it within the service SLAs?
23
+
* Is the P99 latency affected?
24
+
* Are the failures affecting all your application instances or only a subset? When the issue is reduced to a subset of instances, it's commonly a problem related to those instances.
17
25
18
26
## Troubleshooting steps
19
27
The following list contains known causes and solutions for service unavailable exceptions.
@@ -22,12 +30,7 @@ The following list contains known causes and solutions for service unavailable e
22
30
Verify that all the [required ports](sql-sdk-connection-modes.md#service-port-ranges) are enabled.
23
31
24
32
### Client-side transient connectivity issues
25
-
Service unavailable exceptions can surface when there are transient connectivity problems that are causing timeouts. Typically, the stack trace related to this scenario will contain a `TransportException` error. For example:
26
-
27
-
```C#
28
-
TransportException:Aclienttransporterroroccurred:Therequesttimedoutwhilewaitingfor a server response.
Service unavailable exceptions can surface when there are transient connectivity problems that are causing timeouts and can be safely retried following the [design recommendations](conceptual-resilient-sdk-applications.md#timeouts-and-connectivity-related-failures-http-408503).
31
34
32
35
Follow the [request timeout troubleshooting steps](troubleshoot-dot-net-sdk-request-timeout.md#troubleshooting-steps) to resolve it.
33
36
@@ -37,4 +40,6 @@ Check the [Azure status](https://azure.status.microsoft/status) to see if there'
37
40
38
41
## Next steps
39
42
*[Diagnose and troubleshoot](troubleshoot-dot-net-sdk.md) issues when you use the Azure Cosmos DB .NET SDK.
40
-
*Learnaboutperformanceguidelinesfor [.NETv3](performance-tips-dotnet-sdk-v3-sql.md) and [.NETv2](performance-tips.md).
43
+
*[Diagnose and troubleshoot](troubleshoot-java-sdk-v4-sql.md) issues when you use the Azure Cosmos DB Java SDK.
44
+
* Learn about performance guidelines for [.NET](performance-tips-dotnet-sdk-v3-sql.md).
45
+
* Learn about performance guidelines for [Java](performance-tips-java-sdk-v4-sql.md).
0 commit comments