Skip to content

[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
lhotari merged 1 commit into
apache:masterfrom
HQebupt:nettyOps
Apr 12, 2022

Conversation

@HQebupt

@HQebupt HQebupt commented Dec 29, 2021

Copy link
Copy Markdown
Contributor

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

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

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

HQebupt commented Dec 30, 2021

Copy link
Copy Markdown
Contributor Author

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

HQebupt commented Dec 31, 2021

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@HQebupt

HQebupt commented Jan 18, 2022

Copy link
Copy Markdown
Contributor Author

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

@HQebupt

HQebupt commented Jan 29, 2022

Copy link
Copy Markdown
Contributor Author

@Jason918 Jason918 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@HQebupt

HQebupt commented Feb 8, 2022

Copy link
Copy Markdown
Contributor Author

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

@MMirelli

MMirelli commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

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

Comment thread conf/bkenv.sh Outdated

@michaeljmarshall michaeljmarshall left a comment

Copy link
Copy Markdown
Member

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

HQebupt commented Feb 9, 2022

Copy link
Copy Markdown
Contributor Author

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

HQebupt commented Feb 12, 2022

Copy link
Copy Markdown
Contributor Author

@michaeljmarshall @315157973 PTAL

@michaeljmarshall michaeljmarshall left a comment

Copy link
Copy Markdown
Member

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

HQebupt commented Mar 7, 2022

Copy link
Copy Markdown
Contributor Author

The next version, maybe 2.11.0 :)

@HQebupt

HQebupt commented Mar 7, 2022

Copy link
Copy Markdown
Contributor Author

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

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

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

HQebupt commented Mar 8, 2022

Copy link
Copy Markdown
Contributor Author

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

@lhotari lhotari left a comment

Copy link
Copy Markdown
Member

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

HQebupt commented Mar 18, 2022

Copy link
Copy Markdown
Contributor Author

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

HQebupt commented Apr 1, 2022

Copy link
Copy Markdown
Contributor Author

@lhotari PTAL. Thank you.

1 similar comment
@HQebupt

HQebupt commented Apr 2, 2022

Copy link
Copy Markdown
Contributor Author

@lhotari PTAL. Thank you.

@HQebupt

HQebupt commented Apr 2, 2022

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@HQebupt

HQebupt commented Apr 11, 2022

Copy link
Copy Markdown
Contributor Author

/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
Copy Markdown
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