-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Use custom runtime image for bundled JDK #65111
Comments
Pinging @elastic/es-delivery (Team:Delivery) |
Out of curiosity I've played around with Command to create a custom JDK (used
This resulted in the following size for
or just the size of the
So a (relatively) simple Btw, the next biggest contributor to the distribution size is ML and the biggest dependency there (a whopping 160MB - almost as much as the entire size of our stripped down JDK above) is caused by |
If we're including all modules, where is the savings coming from? Is it just compression? Is there any noticable preformance/startup cost?
This is a known "issue". It's the main reason why the aarch64 distribution is so much smaller as well, since this ML dependency is x86-only. |
The majority of savings is coming from the eliminated JMOD files (that are only useful if you want to build a custom JDK but not when you have actually built one, see this great summary on Stackoverflow. Another ~30MB are caused by two class data sharing files that have been eliminated + the include files.
I did not notice any impact at all in startup performance.
Is this tracked anywhere? I could not find anything either here or in the ML repo or is there no intention to change this? |
Is running
I'm not aware of any intention to change this. @droberts195 we are aware of this, but I don't think there is any reasonable fix here other than not using the optimized libraries. In this case we are trading better performance for a larger distribution. |
It's probably not necessary but using
Fair point. While it would be nice to have smaller binaries on all platforms I believe it would already be a step forward if we can reduce the binary size on many platforms. So we could add this step only on platforms where it is safe to do so and keep the original JDK on others.
Ok, I already thought so but thanks for confirming. |
elastic/ml-cpp#2038 contains some details about this.
There are two parts: libtorch and libmkl. libtorch is the bulk of the implementation of PyTorch, and cannot be removed unless we scrap our inference functionality altogether. libmkl makes inference faster on Intel processors. We only ship that with our |
Thanks for the background on this, that's helpful. Given what you said, this library seems like the right tradeoff in terms of performance. |
With Elasticsearch 8.0 we intend to ditch that no-jdk distribution (see #65109), to that end, to make it a little less painful for folks that have to download the full bundled JDK distribution, even though they have no intention of using it, we can look at reducing the footprint of the bundled JDK.
One way to do this is leverage
jlink
to build a custom runtime image with only the JDK modules used by Elasticsearch and its plugins. There are a few things we'll need to sort out:jdeps
against our existing libs/modules/plugins.The text was updated successfully, but these errors were encountered: