-
Notifications
You must be signed in to change notification settings - Fork 2k
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
SwitchOffIOThread #23822
SwitchOffIOThread #23822
Conversation
...cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportClient.java
Show resolved
Hide resolved
...cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportClient.java
Outdated
Show resolved
Hide resolved
...main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java
Outdated
Show resolved
Hide resolved
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 @xinlian12 , please merge once we run the perf
...main/java/com/azure/cosmos/implementation/directconnectivity/rntbd/RntbdServiceEndpoint.java
Outdated
Show resolved
Hide resolved
@@ -16,4 +17,11 @@ | |||
COSMOS_PARALLEL_THREAD_NAME, | |||
Schedulers.DEFAULT_POOL_SIZE, | |||
true); | |||
|
|||
// Custom bounded elastic scheduler to switch off IO thread to process response. | |||
public final static Scheduler TRANSPORT_RESPONSE_BOUNDED_ELASTIC = Schedulers.newBoundedElastic( |
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.
does this need to be released as a resource when the client is closed?
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.
I think yes, we need to dispose it when the client gets closed, otherwise it will not let JVM shut down.
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosSchedulers.java
Show resolved
Hide resolved
/azp run java - cosmos - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
...cosmos/src/main/java/com/azure/cosmos/implementation/directconnectivity/TransportClient.java
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/Configs.java
Show resolved
Hide resolved
@@ -16,4 +17,11 @@ | |||
COSMOS_PARALLEL_THREAD_NAME, | |||
Schedulers.DEFAULT_POOL_SIZE, | |||
true); | |||
|
|||
// Custom bounded elastic scheduler to switch off IO thread to process response. | |||
public final static Scheduler TRANSPORT_RESPONSE_BOUNDED_ELASTIC = Schedulers.newBoundedElastic( |
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.
I think yes, we need to dispose it when the client gets closed, otherwise it will not let JVM shut down.
sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/CosmosSchedulers.java
Show resolved
Hide resolved
/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). |
Benchmark Tests:
BoundedElastic Scheduler vs Parallel Scheduler:
Daemon vs UserThread:
