-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Significant performance difference across JVMs on Mac OS X #86600
Comments
Pinging @elastic/es-delivery (Team:Delivery) |
Pinging @elastic/es-perf (Team:Performance) |
So this is actually due to the fact that I actually did some experimentation with https://github.com/stewartsmith/libeatmydata locally to try and disable fsync but with limited success. It seemed like the JVM wasn't using my dynamic library. Perhaps someone better versed in native code would have a better chance here. I did confirm though that this is an IO problem as even with modern JDKs on the latest Macs, the performance drop disappears if you run Elasticsearch backed by a ramdisk. |
That seems to make sense. But I am a bit confused with the docker results (which are on par with JVM 8). Filesystem access in docker is virtualized or something and that layer does not implement "proper" fsync? |
Yep, basically this. Depending on the underlying fileystem driver being used, more than likely a "proper" fsync is not happening. To the JVM, since we're running in a Docker container, the host is Linux, so it's just doing a normal fsync, when when finally translated to the MacOS filesystem is not doing a real fsync, thus the perceived better performance. |
I'm closing this as it's not actually an issue with Elasticsearch, but a fundamental issue with running any system that does real |
Elasticsearch Version
7.17.3
Installed Plugins
All default plugins that come installed in the docker distribution and on the osx brew tap
Java Version
bundled; OpenJDK Runtime Environment (Temurin)(build 1.8.0_332-b09); OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7); OpenJDK Runtime Environment Temurin-18.0.1+10 (build 18.0.1+10)
OS Version
OSX 12.3.1; Darwin wall-a 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
Problem Description
In OSX (specifically, on a Macbook Pro 2019), I am seeing a very significant difference in indexing performance across different JVMs.
It seems that anything other than Java 8 is quite slower when running directly on the host (vs a docker instance for example).
For the tests I conducted on that machine, I got the following number when trying to index 100 documents across 3 newly created indexes, sequentially:
The particular numbers are not very important. I think that the magnitude of the difference is what matters.
I expected to see the same performance across every experiment, using any JVM. In particular, I expected that Elasticsearch installed through brew, running with a bundled JDK, would have the same (or slightly better) performance than the one running through a docker container.
Steps to Reproduce
I followed official instructions to install and run elasticsearch using brew and docker without any further customization.
For the brew one, I then ran it using different VMs by relying on
JAVA_HOME
and asdf (asdf-java) to change the Java version. Among others, I used specificallytemurin-18.0.1+10
,temurin-17.0.3+7
andtemurin-8.0.332+9
.For testing, I threw some sequential indexing requests using something like:
Logs (if relevant)
I don't know exactly what logs are most relevant but, for now, I will paste the startup snippets showing the different JVMs being picked up.
Java 8
Java 17
Java 18
Bundled JDK
The text was updated successfully, but these errors were encountered: