question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Performance decrease w/Quarkus 1.5.0, Mongo Extension, Mutiny

See original GitHub issue

It seems that there is a considerable throughput performance hit (approx 40%) when upgrading one microservice from an older stack using Quarkus to a newer one.

Older stack:

  • Quarkus 1.2.1
  • JDK 8 (running in OpenJ9)
  • MongoDB extension (with Completion Stages)
  • SOAP Calls (but reproducible with HTTP REST, without SOAP)

Newer stack:

  • Quarkus 1.5.0
  • JDK 11 (running in OpenJ9)
  • MongoDB extension (with Mutiny)
  • SOAP Calls (but reproducible with HTTP REST, without SOAP)

The microservice uses MongoDB for caching. Steps:

  • Querying the DB for a key
    • If the key is found, return the value of this key from the MongoDB.
  • If the key is not found, make an HTTP request
  • Save the result to MongoDB. The result is saved as a model, using a Jackson codec.
  • Return the result to the caller.

Our older stack was using RxJava, and was transforming the CompletionStages to Singles. The new stack uses Mutiny, and also exposes Mutiny Interfaces. In both cases, we use RestEasy interfaces, we are not using Reactive Routes.

On a performance load test lasting for approximately 30 minutes each, I have seen the following differences in performance:

The old stack’s CPU load is something like the following

screenshot_2020-06-22_at_4 06 41_pm

The new stack’s behaviour is totally different, however. Screenshot 2020-06-22 at 4 06 57 PM

It seems observed that the CPU consumption went up by 40%, thus losing throughput in the process. Both tests were conducted on a microservice using the same amount of RAM and CPU limits.

Tests already done to debug this:

  • Switching to OpenJDK11 image. Tested with both the default garbage collector and the old one (-XX:UseParallelGC). The results were very similar (decreased performance).
  • Switching the old implementation using Quarkus 1.2.1 to Java 11 (both OpenJ9). The performance was great (same as the one we had with the old implementation using Java 8)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
csotirioucommented, Jun 23, 2020

Hello,

Just to add to this issue, I switched to the synchronous client in MongoDB, and I still faced problems. I decided to make another test:

  • Use the synchronous MongoDB driver, but return it using Uni.createFrom().item(response) (just to expose Uni interfaces, for testing)
  • Use the synchronous MongoDB driver again, but encapsulate it in RxJava’s Single, to simulate as much of the codebase as the one we had before.

I was surprised to see that using RxJava, without any other change in the code, my performance returned back to normal.

I am led to believe that perhaps Mutiny itself (regardless of how it’s used inside the Mongo extension) is the real issue here.

0reactions
geoandcommented, Apr 23, 2021

That’s awesome, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

release - Quarkus
Final fixes a performance regression introduced in Quarkus 2.12.0.Final. ... Final with exciting new features such as a brand new WebAuthn extension.
Read more >
Using the MongoDB Client - Quarkus
The Liquibase MongoDB extension facilitates the initialization of a MongoDB database including indices and initial data. It implements the same schema migration ...
Read more >
Massive performance without headaches - Quarkus
When returning Mutiny types using RESTEasy Reactive, everything happens on the IO Thread (except if the endpoint is annotated with @Blocking ).
Read more >
Guides - Latest - Quarkus
This guide demonstrates how your Quarkus application can utilize the SmallRye Fault Tolerance specification through the SmallRye Fault Tolerance extension.
Read more >
chore(deps): update dependency io.quarkus:quarkus ... - GitLab
An error occurred while retrieving approval data for this merge request. chore(deps): update dependency io.quarkus:quarkus ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found