Closed csotiriou closed 3 years ago
/cc @loicmathieu
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:
Uni.createFrom().item(response)
(just to expose Uni
interfaces, for testing)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.
There is an ongoing discussion with @johnaohara on Zulip. Hopefully, this will provide useful feedback.
Do you have context propagation enabled?
Yes, we use the smallrye context propagation dependency.
Thanks for the very quick response. @johnaohara, that can explain the overhead due to the numbers of interception.
(Even on a simple: Uni.createFrom(item)
you have 2 interceptions.)
That would explain why even after ditching the asynchonous mongo driver still creates problems when even synchronous results are mixed with plain Uni.createFrom().
I would like to clarify that I always had context propagation enabled even with the old implementation that used RxJava (no performance issues there).
yes, but mutiny enables it automatically, RX does not (it requires an additional dependency).
I understand. Does this mean that if I was including the context propagation extra dependency for RXJava I would see the same performance hit as with mutiny?
Or this is something that can be improved on the side of mutiny/context propagation library ?
In the mutiny side, definitely - especially for Uni. It’s actually planned. It would be great to have a way to reproduce your case, so I can test the improvements.
Did we come to a conclusion on this one? Has it since been remedied?
We have done some improvements in Mutiny. The context-propagation issue is still valid I guess.
@csotiriou would it be possible to try Quarkus 1.12
and / or the Quarkus Snapshots to see if the issue still persists?
@geoand, it seems that the issue is fixed, I have experienced no more crashes and strange behaviour.
That's awesome, thanks!
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:
Newer stack:
The microservice uses MongoDB for caching. Steps:
Our older stack was using RxJava, and was transforming the
CompletionStage
s toSingle
s. 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
The new stack's behaviour is totally different, however.
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:
-XX:UseParallelGC
). The results were very similar (decreased performance).