-
Notifications
You must be signed in to change notification settings - Fork 374
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
[CELEBORN-1815] Support UnpooledByteBufAllocator #3043
Conversation
source.addGauge( | ||
MetricRegistry.name(metricPrefix, "usedDirectMemory"), | ||
labels, | ||
unpooledMetric::usedDirectMemory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UnpooledByteBufAllocator only supports these two metrics
@@ -45,7 +45,7 @@ public FlinkTransportClientFactory( | |||
TransportContext context, List<TransportClientBootstrap> bootstraps, int bufferSizeBytes) { | |||
super(context, bootstraps); | |||
bufferSuppliers = JavaUtils.newConcurrentHashMap(); | |||
this.pooledAllocator = new UnpooledByteBufAllocator(true); | |||
this.allocator = new UnpooledByteBufAllocator(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting... Flink client overrides it to forcibly use UnpooledByteBufAllocator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is related to this PR. The Flink client's memory is quite limited.
#1324
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@FMX Thanks for the information. BTW, it's better to leave some brief comments to explain the special logic
boolean allowDirectBufs, boolean allowCache, int numCores) { | ||
if (numCores == 0) { | ||
numCores = Runtime.getRuntime().availableProcessors(); | ||
private static ByteBufAllocator createByteBufAllocator( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method comments should also be updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: move the existing comment to the caller side, add new comments to explain each parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. except a nit.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3043 +/- ##
==========================================
- Coverage 32.68% 32.67% -0.00%
==========================================
Files 336 336
Lines 20032 20053 +21
Branches 1792 1796 +4
==========================================
+ Hits 6546 6551 +5
- Misses 13123 13137 +14
- Partials 363 365 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thanks, merged to main(0.6) |
What changes were proposed in this pull request?
This PR introduces a configuration
celeborn.network.memory.allocator.pooled
to allow users to disablePooledByteBufAllocator
globally and always useUnpooledByteBufAllocator
.Why are the changes needed?
In some extreme cases, the Netty's
PooledByteBufAllocator
might have tons of 4MiB chunks but only a few sizes of the capacity are used by the real data(see #3018), for scenarios that stability is important than performance, it's desirable to allow users to disable thePooledByteBufAllocator
globally.Does this PR introduce any user-facing change?
Add a new feature, disabled by default.
How was this patch tested?
Pass UT to ensure correctness. Performance and memory impact need to be verified in the production scale cluster.