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

Share netty event loops between transports #46346

Merged
merged 10 commits into from
May 11, 2020

Conversation

Tim-Brooks
Copy link
Contributor

Currently Elasticsearch creates independent event loop groups for each
transport (http and internal) transport type. This is unnecessary and
can lead to contention when different threads access shared resources
(ex: allocators). This commit moves to a model where, by default, the
event loops are shared between the transports. The previous behavior can
be attained by specifically setting the http worker count.

Currently Elasticsearch creates independent event loop groups for each
transport (http and internal) transport type. This is unnecessary and
can lead to contention when different threads access shared resources
(ex: allocators). This commit moves to a model where, by default, the
event loops are shared between the transports. The previous behavior can
be attained by specifically setting the http worker count.
@Tim-Brooks Tim-Brooks added >non-issue :Distributed Coordination/Network Http and internode communication implementations v8.0.0 v7.5.0 labels Sep 4, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

I've left some comments around the lifecycle of these groups

@Tim-Brooks Tim-Brooks added v7.6.0 and removed v7.5.0 labels Oct 17, 2019
@Tim-Brooks Tim-Brooks requested a review from ywelsch October 18, 2019 02:17
@Tim-Brooks
Copy link
Contributor Author

I updated this for the comments. I'm not sure what to do on the thread count thing. I know in the team-discuss we said maybe we should reduce the make the minimum at least 4 (because 4 was theoretically the single core minimum before). But the setting allows the user to configure a minimum of 1 which means I would be breaking that. Are we okay with that?

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

@tbrooks8 can you merge latest master here? I've left a 2 minor comments, o.w. looking good.

assertFalse(transportGroup.getLowLevelGroup().isShuttingDown());
transportGroup.shutdown();
assertTrue(httpGroup.getLowLevelGroup().isShuttingDown());
assertTrue(transportGroup.getLowLevelGroup().isShuttingDown());
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also check the termination future? i.e. whether the shutdown has actually completed here?

@polyfractal polyfractal added v7.7.0 and removed v7.6.0 labels Jan 15, 2020
@bpintea bpintea added v7.8.0 and removed v7.7.0 labels Mar 25, 2020
@Tim-Brooks Tim-Brooks closed this Apr 30, 2020
@Tim-Brooks Tim-Brooks deleted the shard_event_loops branch April 30, 2020 18:25
@Tim-Brooks Tim-Brooks restored the shard_event_loops branch April 30, 2020 18:25
@Tim-Brooks Tim-Brooks reopened this May 11, 2020
@Tim-Brooks Tim-Brooks added v7.9.0 and removed v7.8.0 labels May 11, 2020
@Tim-Brooks
Copy link
Contributor Author

I have addressed the previous comments on this PR.

Copy link
Member

@original-brownbear original-brownbear 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 Tim!

@Tim-Brooks Tim-Brooks merged commit 0bf4be7 into elastic:master May 11, 2020
Tim-Brooks added a commit to Tim-Brooks/elasticsearch that referenced this pull request May 11, 2020
Currently Elasticsearch creates independent event loop groups for each
transport (http and internal) transport type. This is unnecessary and
can lead to contention when different threads access shared resources
(ex: allocators). This commit moves to a model where, by default, the
event loops are shared between the transports. The previous behavior can
be attained by specifically setting the http worker count.
DaveCTurner added a commit to DaveCTurner/elasticsearch that referenced this pull request Jan 27, 2021
In elastic#46346 we changed the distribution of work across event loops but
this was marked as a `>non-issue` so did not get a mention in the
release notes. However, plugin authors might need to be aware of this
change, so this commit records it in the release notes as an enhancement
instead.

Closes elastic#67960
DaveCTurner added a commit that referenced this pull request Feb 8, 2021
In #46346 we changed the distribution of work across event loops but
this was marked as a `>non-issue` so did not get a mention in the
release notes. However, plugin authors might need to be aware of this
change, so this commit records it in the release notes as an enhancement
instead.

Closes #67960
DaveCTurner added a commit that referenced this pull request Feb 8, 2021
In #46346 we changed the distribution of work across event loops but
this was marked as a `>non-issue` so did not get a mention in the
release notes. However, plugin authors might need to be aware of this
change, so this commit records it in the release notes as an enhancement
instead.

Closes #67960
DaveCTurner added a commit that referenced this pull request Feb 8, 2021
In #46346 we changed the distribution of work across event loops but
this was marked as a `>non-issue` so did not get a mention in the
release notes. However, plugin authors might need to be aware of this
change, so this commit records it in the release notes as an enhancement
instead.

Closes #67960
DaveCTurner added a commit that referenced this pull request Feb 8, 2021
In #46346 we changed the distribution of work across event loops but
this was marked as a `>non-issue` so did not get a mention in the
release notes. However, plugin authors might need to be aware of this
change, so this commit records it in the release notes as an enhancement
instead.

Closes #67960
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.

7 participants