-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proactive connection management #33983
Proactive connection management #33983
Conversation
…oactiveConnectionManagementForBrokenConnections � Conflicts: � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/IOpenConnectionsHandler.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/GatewayAddressCache.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/HttpTransportClient.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClient.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/SharedTransportClient.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportClient.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdOpenConnectionsHandler.java � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java � sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/SessionNotAvailableRetryTest.java � sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/implementation/directconnectivity/RntbdTransportClientTest.java
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
…into ProactiveConnectionManagementForBrokenConnections
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
9dd8a97
to
52f8b03
Compare
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the great work :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks
…ttps://github.com/jeet1995/azure-sdk-for-java into ProactiveConnectionManagementForBrokenConnections � Conflicts: � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/ProactiveOpenConnectionsProcessor.java
…BrokenConnections LockChange
…ttps://github.com/jeet1995/azure-sdk-for-java into ProactiveConnectionManagementForBrokenConnections � Conflicts: � sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/ProactiveOpenConnectionsProcessor.java
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
Re-ran the following tests locally.
|
/check-enforcer override |
Features
Minimum connection pool size per endpoint
Using a system config, the application developer can specify the minimum no. of connections to be set for all endpoints for all physical partitions across all containers whose connections are opened using the
openConnectionsAndInitCaches
flow either throughCosmosClient
/CosmosAsyncClient
orCosmosContainer
/CosmosAsyncContainer
. This can help alleviate the cold start latency associated with establishing connections on-demand when requests are made by the SDK.Setting the minimum connection pool size per endpoint through a system config
Aggressive connection establishment time duration
In the
openConnectionsAndInitCaches
flow forCosmosClient
/CosmosAsyncClient
, a duration can be specified within which connections are established aggressively in a blocking manner. Once this duration elapses, connections are established defensively but in a non-blocking manner. This improves on the previous flow which only opened connections in a blocking manner therefore preventing the SDK from making requests until all connections were established.Setting the aggressive proactive connection establishment duration through the public API
Proactive connection management during connection close and reset
This PR helps proactively re-establish connections which are reset by the server or if they have been gracefully closed or in cases where the channel was closed due to it being unhealthy or idle.
Design considerations
COSMOS.DEFENSIVE_WARMUP_CONCURRENCY
can be used to modify the defensive concurrency.Benchmarking results
Insights
Reads (Provisioned throughput : 1 million RUs, Concurrency : 512, Documents to read: 10 thousand, Operations count: 1 million)
Reads (Provisioned throughput : 1 million RUs, Concurrency : 128, Documents to read: 10 thousand, Operations count: 1 million)
Reads (Provisioned throughput : 1 million RUs, Concurrency : 512, Documents to read: 10 thousand, Operations count: 1 million, proactive connection management with aggressive connection establishment duration)
Reads (Provisioned throughput : 1 million RUs, Concurrency : 128, Documents to read: 10 thousand, Operations count: 1 million, proactive connection management with aggressive connection establishment duration)
Reads (Provisioned throughput : 20 thousand RUs, Concurrency : 10, Documents to read: 1 thousand, Operations count: 100 thousand)
Writes (Provisioned throughput : 1 million RUs, Concurrency : 512, Operations count: 1 million)
Writes (Provisioned throughput : 1 million RUs, Concurrency : 128, Operations count: 1 million)
Writes (Provisioned throughput : 1 million RUs, Concurrency : 512, Operations count: 1 million, proactive connection management with aggressive connection establishment duration)
Writes (Provisioned throughput : 1 million RUs, Concurrency : 128, Operations count: 1 million, proactive connection management with aggressive connection establishment duration)
Writes (Provisioned throughput : 20 thousand RUs, Concurrency : 10, Operations count: 100 thousand)