Skip to content
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

Merged
merged 8 commits into from
Sep 2, 2021
Merged

SwitchOffIOThread #23822

merged 8 commits into from
Sep 2, 2021

Conversation

xinlian12
Copy link
Member

@xinlian12 xinlian12 commented Aug 30, 2021

  1. Switch off from IO thread for response processing, based on configuration
  2. Release channel after write the request to the channel

Benchmark Tests:

BoundedElastic Scheduler vs Parallel Scheduler:

image

image

image

image

Daemon vs UserThread:
image

image

image

image

Copy link
Member

@simplynaveen20 simplynaveen20 left a 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

@@ -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(
Copy link
Contributor

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?

Copy link
Member

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.

@xinlian12
Copy link
Member Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -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(
Copy link
Member

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.

@xinlian12
Copy link
Member Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xinlian12
Copy link
Member Author

/azp run java - cosmos - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@xinlian12 xinlian12 merged commit 7bf220a into Azure:main Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants