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

[Improvement] Recycler should use io.netty.recycler.maxCapacityPerThread instead of io.netty.recycler.maxCapacity.default as maxCapacityPerThread configuration in Netty 4.1.x #13563

Merged
merged 1 commit into from
Apr 12, 2022

Conversation

HQebupt
Copy link
Contributor

@HQebupt HQebupt commented Dec 29, 2021

Fixed #13757

Motivation

The configuration io.netty.recycler.maxCapacity.default does not work in Netty 4.1.x. And The Recycler class should use io.netty.recycler.maxCapacityPerThread or io.netty.recycler.maxCapacity as maxCapacityPerThread configuration in Netty 4.1.x.

Modifications

Change io.netty.recycler.maxCapacity.default to io.netty.recycler.maxCapacityPerThread in start up script.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • no-need-doc

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Dec 29, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

This is interesting.

Do you have some numbers about the impact of this change?

As this is broken and current property is not taking effect...
Why not removing the property at all and let users configure it?

I am not sure about the actual benefit or the impact of restoring that option

@merlimat @MMirelli @dave2wave

@HQebupt
Copy link
Contributor Author

HQebupt commented Dec 30, 2021

This is interesting.

Do you have some numbers about the impact of this change?

As this is broken and current property is not taking effect... Why not removing the property at all and let users configure it?

I am not sure about the actual benefit or the impact of restoring that option

@merlimat @MMirelli @dave2wave

Hi Enrico, I did not see any performance impact. I agree with you. And we can use the default value (io.netty.recycler.maxCapacityPerThread=4096) explicitly in that it keeps the same configuration as before in Pulsar. How about it?

@HQebupt
Copy link
Contributor Author

HQebupt commented Dec 31, 2021

/pulsarbot run-failure-checks

@HQebupt
Copy link
Contributor Author

HQebupt commented Jan 18, 2022

Hi @eolivelli @merlimat @MMirelli @dave2wave , what are your thoughts ? Looking forward your response.

@HQebupt
Copy link
Contributor Author

HQebupt commented Jan 29, 2022

@codelipenghui @hangc0276 @Jason918 @Shoothzj PTAL

Copy link
Contributor

@Jason918 Jason918 left a comment

Choose a reason for hiding this comment

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

LGTM

@HQebupt
Copy link
Contributor Author

HQebupt commented Feb 8, 2022

@eolivelli Hi Enrico, Please take a look the PR, thanks in advance.

@MMirelli
Copy link
Contributor

MMirelli commented Feb 8, 2022

I will check whether this may cause evident perf degradation within this week, hopefully. Thank you for pointing this out.

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

Hi Enrico, I did not see any performance impact. I agree with you. And we can use the default value (io.netty.recycler.maxCapacityPerThread=4096) explicitly in that it keeps the same configuration as before in Pulsar. How about it?

@HQebupt - can you explain why 4096 is the same configuration as before? It seems like 1000 was the configuration before.

@HQebupt
Copy link
Contributor Author

HQebupt commented Feb 9, 2022

Hi Enrico, I did not see any performance impact. I agree with you. And we can use the default value (io.netty.recycler.maxCapacityPerThread=4096) explicitly in that it keeps the same configuration as before in Pulsar. How about it?

@HQebupt - can you explain why 4096 is the same configuration as before? It seems like 1000 was the configuration before.
Please see https://github.com/netty/netty/blob/d5faba2fbeb7da65daa0a10f41560f47443c1026/common/src/main/java/io/netty/util/Recycler.java#L49

image

@HQebupt
Copy link
Contributor Author

HQebupt commented Feb 12, 2022

@michaeljmarshall @315157973 PTAL

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

LGTM.

@HQebupt - thanks for the reference. Do you know which versions of Pulsar need this patch?

@HQebupt
Copy link
Contributor Author

HQebupt commented Mar 7, 2022

The next version, maybe 2.11.0 :)

@HQebupt
Copy link
Contributor Author

HQebupt commented Mar 7, 2022

@codelipenghui Hi penghui, could you please merge this pr since three committers approved it already ? thanks in advance.

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

Please replace all occurences of -Dio.netty.recycler.maxCapacity.default=1000 with -Dio.netty.recycler.maxCapacityPerThread=4096 in all source files (including documentation).

@HQebupt
Copy link
Contributor Author

HQebupt commented Mar 8, 2022

@lhotari @hangc0276 @eolivelli @315157973 PTAL again. Thanks

Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

The io.netty.recycler.linkCapacity system property was removed in Netty 4.1.71.Final
by commit netty/netty@40196a63 . Please also remove all references to io.netty.recycler.linkCapacity.

@HQebupt
Copy link
Contributor Author

HQebupt commented Mar 18, 2022

The io.netty.recycler.linkCapacity system property was removed in Netty 4.1.71.Final
by commit netty/netty@40196a63 . Please also remove all references to io.netty.recycler.linkCapacity.

@lhotari Apology for delay fix. PTAL. Thanks

@HQebupt HQebupt requested a review from lhotari March 18, 2022 06:31
@HQebupt
Copy link
Contributor Author

HQebupt commented Apr 1, 2022

@lhotari PTAL. Thank you.

1 similar comment
@HQebupt
Copy link
Contributor Author

HQebupt commented Apr 2, 2022

@lhotari PTAL. Thank you.

@HQebupt
Copy link
Contributor Author

HQebupt commented Apr 2, 2022

/pulsarbot run-failure-checks

@HQebupt
Copy link
Contributor Author

HQebupt commented Apr 11, 2022

/pulsarbot run-failure-checks

@lhotari lhotari merged commit 4721ce1 into apache:master Apr 12, 2022
aparajita89 pushed a commit to aparajita89/pulsar that referenced this pull request Apr 18, 2022
Nicklee007 pushed a commit to Nicklee007/pulsar that referenced this pull request Apr 20, 2022
@congbobo184 congbobo184 added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Nov 4, 2022
congbobo184 pushed a commit that referenced this pull request Nov 30, 2022
liangyepianzhou pushed a commit that referenced this pull request Dec 6, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Dec 6, 2022
…4.1.x (apache#13563)

(cherry picked from commit 4721ce1)
(cherry picked from commit 5206262)
@hangc0276
Copy link
Contributor

This PR is tagged with 2.8.5, when we cherry-pick this PR into branch-2.8, we also need to cherry-pick #19441, otherwise, the bookie couldn't apply the memory and GC configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid config item -Dio.netty.recycler.maxCapacity.default