Skip to content

Change default of io.netty.allocator.useCacheForAllThreads to false - #8991

Merged
normanmaurer merged 1 commit into
masterfrom
use_cache_for_all_threads
Apr 1, 2019
Merged

normanmaurer merged 1 commit into
masterfrom
use_cache_for_all_threads

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads. We should better not do this by default to keep suprises to a minimum. Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to #8536.

@normanmaurer

Copy link
Copy Markdown
Member Author

/cc @doom369 @njhill @franz1981 @johnou

@normanmaurer normanmaurer added this to the [Netty 5] ByteBuf changes / enhancements milestone Apr 1, 2019

@franz1981 franz1981 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.

I've recently received a feedback about this specific setting from one power user of ActiveMQ Artemis from the community: telepathy?
lgtm

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads. We should better not do this by default to keep suprises to a minimum. Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to #8536.
@normanmaurer
normanmaurer force-pushed the use_cache_for_all_threads branch from 1c02a06 to ae7b90b Compare April 1, 2019 07:27

@johnou johnou 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, it should be pretty obvious in load tests if this causes performance regressions.

@trustin

trustin commented Apr 1, 2019

Copy link
Copy Markdown
Member

SGTM

@ejona86 ejona86 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.

gRPC has also seen performance issues caused by initializing the cache for new threads (like seen in grpc/grpc-java#1758), when users aren't using a thread pool.

@vkostyukov vkostyukov 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

I don't think we ever use allocators outside of event loop threads in Finagle.

@normanmaurer
normanmaurer merged commit 78c4abb into master Apr 1, 2019
@normanmaurer
normanmaurer deleted the use_cache_for_all_threads branch April 1, 2019 17:43
chrisvest pushed a commit to chrisvest/netty that referenced this pull request Feb 28, 2022
…etty#8991)

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads.
We should better not do this by default to keep suprises to a minimum.
Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to netty#8536.
normanmaurer added a commit that referenced this pull request Mar 3, 2022
…8991) (#12109)

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads.
We should better not do this by default to keep suprises to a minimum.
Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to #8536.

Co-authored-by: Norman Maurer <[email protected]>
raidyue pushed a commit to raidyue/netty that referenced this pull request Jul 8, 2022
…etty#8991) (netty#12109)

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads.
We should better not do this by default to keep suprises to a minimum.
Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to netty#8536.

Co-authored-by: Norman Maurer <[email protected]>
franz1981 pushed a commit to franz1981/netty that referenced this pull request Aug 22, 2022
…etty#8991) (netty#12109)

Motivation:

We currently use a thread local cache for all threads which often is suprising to users as it may result in a lot of memory usage if they allocate buffers from outside the EventLoop in different threads.
We should better not do this by default to keep suprises to a minimum.
Users that need the performance and know what they are doing can still change this.

Modifications:

Change io.netty.allocator.useCacheForAllThreads to false by default

Result:

Related to netty#8536.

Co-authored-by: Norman Maurer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants