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

Add a dedicated threadpool for node connections #30150

Closed
wants to merge 5 commits into from

Conversation

PnPie
Copy link
Contributor

@PnPie PnPie commented Apr 25, 2018

Add a new dedicated threadpool for establishing node connections, instead of using management thread pool as it's a small and important threadpool used by many other operations.

Relates to #29023

Add a new dedicated threadpool for establishing node connections, instead of using management thread pool as it's a small and important threadpool used by many other actions.
@colings86 colings86 added >enhancement :Core/Infra/Core Core issues without another label labels Apr 26, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@javanna
Copy link
Member

javanna commented May 7, 2018

I wonder if we should have a unit test that verifies we are using a different threadpool. @elastic/es-core-infra thoughts on this and the change itself?

@PnPie
Copy link
Contributor Author

PnPie commented May 13, 2018

Hi @javanna I added a test to check using the new threadpool.

@javanna javanna added the review label May 14, 2018
@javanna
Copy link
Member

javanna commented May 14, 2018

thanks @PnPie ! @elastic/es-core-infra this is ready for review

Copy link
Contributor

@DaveCTurner DaveCTurner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise this was open so I opened
#31546. This looks better, however, so I closed it again. I left a couple of comments. The only other thing is that there are docs to update - see https://github.com/elastic/elasticsearch/pull/31546/files#diff-7bb7428e5b1712bb358a0bb44321d9a6

@@ -89,13 +89,12 @@ public void connectToNodes(DiscoveryNodes discoveryNodes) {
if (connected) {
latch.countDown();
} else {
// spawn to another thread to do in parallel
threadPool.executor(ThreadPool.Names.MANAGEMENT).execute(new AbstractRunnable() {
threadPool.executor(ThreadPool.Names.NODE_CONNECTIONS).execute(new AbstractRunnable() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the ConnectionChecker below could also reasonably run on the NODE_CONNECTIONS threadpool.

@@ -186,6 +188,7 @@ public ThreadPool(final Settings settings, final ExecutorBuilder<?>... customBui
builders.put(Names.FETCH_SHARD_STARTED, new ScalingExecutorBuilder(Names.FETCH_SHARD_STARTED, 1, 2 * availableProcessors, TimeValue.timeValueMinutes(5)));
builders.put(Names.FORCE_MERGE, new FixedExecutorBuilder(settings, Names.FORCE_MERGE, 1, -1));
builders.put(Names.FETCH_SHARD_STORE, new ScalingExecutorBuilder(Names.FETCH_SHARD_STORE, 1, 2 * availableProcessors, TimeValue.timeValueMinutes(5)));
builders.put(Names.NODE_CONNECTIONS, new ScalingExecutorBuilder(Names.NODE_CONNECTIONS, 1, 2 * availableProcessors, TimeValue.timeValueMinutes(5)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels too small to me, for larger clusters. Connecting to a node is not a resource-intensive operation but it might take a long time to time out, blocking other connection attempts. Perhaps this is a reasonable default and we can note in the docs that larger clusters may prefer to increase this limit?

@PnPie
Copy link
Contributor Author

PnPie commented Jun 26, 2018

Hi @DaveCTurner I updated the PR.

@DaveCTurner
Copy link
Contributor

This looks ok to me but I'm not intimately familiar with this area of the code so I'd rather not give it a final LGTM. Could someone from @elastic/es-core-infra take a look at this please?

@rjernst rjernst removed the review label Oct 10, 2018
@danielmitterdorfer
Copy link
Member

Hi @PnPie! Thank you very much for your pull request and the work that you put into it. I am sorry that it fell through the cracks.

We recently implemented a change in #35144 that will enable us to open connections asynchronously. This means that there is no need for a dedicated threadpool anymore which in turn makes this PR, unfortunately, obsolete. Therefore, I hope that you understand I close this PR without merging.

@PnPie
Copy link
Contributor Author

PnPie commented Dec 8, 2018

Thanks @danielmitterdorfer for replying and explaning the context, so that I can also have a look at the related changes :)

@danielmitterdorfer
Copy link
Member

You are welcome and thanks for your understanding. Glad that you find the additional information helpful. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants