GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — Add the AdaptivePoolingAllocator by chrisvest · Pull Request #13075 · netty/netty Conversation
|
|
One issue that's new here is that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Cannot wait to review and benchmark it!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
This is a great step forward @chrisvest : the other thing (separated but still related) that would make for a better virtual thread adoption (running IN the Netty event loop, using it as a scheduler) would be to address the arenas locks: I will open it as a separate issue in the new year, explaining why/how it could happen and probably the easiest workaround would be to revert back using synchronized (that will block/pin temporary the carrier thread) but in an ideal world a proper fix should address it fully. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Another issue with this worth pointing out: preferred chunk size is adapted on a per magazine basis, so if two different magazines compute very different preferred chunk sizes, and then share chunks via the central queue, then they might be unhappy with the chunks in the queue. There are two ways, that I can see, around that: one is to remove the central queue and stop sharing chunks, but in turn we'll likely need magazines to be able to hold more than just one next-in-line chunk. Maybe that needs to be turned into a queue. The other way is merge the histograms from the different magazines in some way so we can compute a single preferred chunk size for everyone. This is probably an easier performance model to comprehend, but will need to be done without adding too much contention; both rotating histograms and obtaining the preferred chunk size need to remain fast. We also shouldn't allow a single very busy magazine to dominate the data feeding into the computation. EDIT Solved this by computing chunk sizes locally, and then iterating all magazines and picking the max chunk size. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
42b1124 to
c6c3744
Compare
|
These are the numbers with the latest optimizations, but this time using the UnsafeBuffer implementation because it responds better to them (it does fewer allocations and makes the numbers more predictable): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
185c259 to
71a0792
Compare
b20110b to
d3c3160
Compare
d3c3160 to
d2b20bc
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@chrisvest the results you shared with Said that; is a a wonderful model, way simpler to reason about if compared to the original one, already loving it! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@franz1981 I used 8 threads for the concurrent benchmark. The default. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This might currently have some messed up lifecycle tracking, that will be confusing if there are leaks. I'll have to take a look at that before we merge this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
d2b20bc to
eeb35c2
Compare
… not going to try allocating from a magazine anyway
… buffers allocated from the adaptable pooling allocator
When allocating chunks, we make them 10 times the preferred chunk size, if this is greater than the minimum chunk size. We need to limit the size of the buffers that we pool, so that we prevent this 10x multiplication from overflowing int. It also makes some sense to not pool extremely large buffers. We use the same max chunk size as the old PooledBufferAllocator. This gives us a cut-off point of ~100 MiB, where we don't pool buffers if they are bigger than this.
Using a shift instead of a plus meant we got 128 buckets instead of the intended 8.
Also add javadocs and allow the central queue construction to be customized.
It does not show up in the benchmark that I can see, but checking the stamped locks a few more times should be cheaper than doing an unpooled allocation
We measure opening a stream, sending some data back and forth, and closing the stream. The benchmark is parameterized over different transports, TLS on or off, and using the adaptive vs. pooled buffer allocators.
… a chunk buffer while the central queue is full
This is how we've been referring to it everywhere else all along. Let's be consistent and lean into that name.
cf77eee to
f009dc8
Compare
It does not need to iterate itself several times to recreate the scenario.
|
This was merged into 4.x, so let's merge it here as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks a lot ! This is awesome work |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…cify netty memory allocator ### What changes were proposed in this pull request? Support `celeborn.network.memory.allocator.type` to specify netty memory allocator including `AdaptiveByteBufAllocator `. ### Why are the changes needed? Netty 4.2 introduces `AdaptiveByteBufAllocator` an auto-tuning pooling `ByteBufAllocator` which uses `AdaptivePoolingAllocator` added in netty/netty#13075. ### Does this PR resolve a correctness bug? No. ### Does this PR introduce _any_ user-facing change? Introduce `celeborn.network.memory.allocator.type` to specify netty memory allocator. ### How was this patch tested? CI. Closes #3625 from SteNicholas/CELEBORN-2280. Authored-by: SteNicholas <[email protected]> Signed-off-by: SteNicholas <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.