Skip to content
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

[GR-54752] Very slow warmup with Graal Compiler JIT (in a Netty-based application) #9115

Open
guilgaly opened this issue Jun 14, 2024 · 4 comments
Assignees

Comments

@guilgaly
Copy link

Describe the issue

Running the Gatling load testing tool (which relies heavily on Netty internally) on GraalVM CE, we have noticed very slow warmups compared to running with the traditionnal C2 JIT compiler (with the warmup period taking 5 times as long or more).

We also observe this with a simplified use case built directly with Netty. We are particularly interested in GraalVM because of Truffle, but our reproducer here is purely in Java.

Are these long warmup times to be expected at the moment with the Graal JIT compiler or would you consider there is something specific going on here? Are there plans for improvements? Are there tuning options we should investigate?

Steps to reproduce the issue

We have a simplified reproducer here: https://github.com/gatling/bug-report-graal-compiler-warmup

It runs a simple HTTP server and client (both based on Netty) in the same process. The client opens n connections, performs the same HTTP request over and over again on each connection, and logs the total throughput every quarter of a second.

Results of our tests can be seen here (with the data also converted to more readable graphs in the HTML files): https://github.com/gatling/bug-report-graal-compiler-warmup/tree/main/test-results/2024-06-11. They all run on the same machine, using either Azul Zulu (so with the usual C2 JIT compiler), GraalVM CE, or Oracle GraalVM. The stable throughput after the warm-up period is quite comparable, but the warm-up times are very different:

  • With Zulu, it takes about 7 seconds.
  • With GraalVM CE, it takes about 45 seconds (including more than 30 seconds to reach just half of the final througput).
  • With Oracle GraalVM, it takes about 25 seconds (although at least we reach about 80% of the final throuput after about 12 seconds).

Describe GraalVM and your environment:

  • GraalVM version:
    • GraalVM CE: CE 22.0.1 8.1 (build 22.0.1 8-jvmci-b01)
    • Oracle GraalVM: 22.0.1 8.1 (build 22.0.1 8-jvmci-b01)
    • Azul Zulu (for reference comparison): Zulu22.30 13-CA (build 22.0.1 8)
  • JDK major version: 22
  • OS: Amazon Linux 2
  • Architecture: AMD64 (tested on an AWS EC2 C6i.2xlarge instance)

More details

Please don't hesitate to let us know if we can provide usefull additional test data, try out different tuning options, etc.

@guilgaly guilgaly added the bug label Jun 14, 2024
@davleopo
Copy link
Member

thank you @guilgaly for your report. Depending on a particular workload warmup can be faster/slower with different JITs - there are many things that influence it. Without having looked into the workload in detail the differences you are seeing are large enough to potentially indicate a bug on our side. We will have a look and get back to you.

@rmosaner can you have a look at the reproducer?

BTW: did you also try native image (https://www.graalvm.org/latest/reference-manual/native-image/) ?

@rmosaner
Copy link
Member

I will have a look.
This is tracked internally as [GR-54752]

@slandelle
Copy link

slandelle commented Jun 14, 2024

BTW: did you also try native image (https://www.graalvm.org/latest/reference-manual/native-image/) ?

@davleopo We haven't. We're not there yet at Gatling. Our focus with GraalVM for now is Truffle/GraalJS.
We've trimmed down our reproducer to only use Netty which is the core underlying technology we use.

@davleopo
Copy link
Member

@slandelle thanks for the clarification. If you ever get around trying it out and you encounter any problems let us know.

In the meantime we will have a look at your reproducer at get back to you, thanks.

@fniephaus fniephaus changed the title Very slow warmup with Graal Compiler JIT (in a Netty-based application) [GR-54752] Very slow warmup with Graal Compiler JIT (in a Netty-based application) Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants