-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add the ability to configure Netty's default allocator #6661
Conversation
What is the benefit for a public interface for this? Could users inject this and change the configuration post-startup and the configuration would take effect? |
They could use a |
@graemerocher just to make sure: I just need this PR and the configuration in my app, right? It is not necessary to start the native image with any |
It will go up just in smaller increments instead of increments of 16mb |
I see the same behaviour as before. With the changes in this PR:
With the latest snapshot available on OSS Sonatype:
|
What I see is:
So no idea what is going with your machine, perhaps someone else can try it out. |
This is with a simple hello world app not the sample from Jason's original issue |
I was using our basic-app just sending a hello world request. |
🤷♂️ |
So I have tried this branch locally, and I added: netty:
default:
allocator:
max-order: 1 to my configuration. I can see an initial memory consumption of 46MB. After 5 requests, it uses 57MB and consumption is stable.
after 7 requests:
|
@jameskleeh can this be merged? |
* @author graemerocher | ||
*/ | ||
public interface ByteBufAllocatorConfiguration { | ||
String DEFAULT_ALLOCATOR = "netty.default.allocator"; |
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.
What is the value of default
in the key? Are there other allocators that are not default?
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.
Potentially you could have different allocators although we don't currently allow anything but the default. Still I think it helps clarify that what you are configuring is the default allocator used by Netty
we still haven't decided on the netty module structure either: #6657 (comment) |
@yawkat it seems overkill to me to create a whole new module for just this functionality when it relates to configuring the Netty buffer which we already have an appropriately named module for. |
though looking at this pr, it wouldnt be proper in a netty-graal module either, since it has nothing to do with graal. and three modules would be a bit much. so i change my vote to putting all the netty stuff into netty-buffer, and making gcp depend on netty-buffer :) |
Any news about this problem? Application running on Kubernetes cluster this was run without -> |
Seems unrelated. File a ticket with steps to reproduce |
With the following configuration and this PR merged:
Memory consumption stays stable at around 24mb RSS after 5 requests. I conducted some brief benchmarking with
wrk
and it seems to make no difference performance wise for simple JSON messages.We can perhaps consider making it a default for new apps in Launch that use Netty
Fixes #6623