You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I understand, Quarkus and all its modules (OIDC handling, Panache…) are designed for lazy initialisation. This has a lot of advantages but leads to slow "first access" (very first request can take more than a second; first access to any endpoint is way slower than consecutive ones).
I have a case in where all my requests must responds quick, event after a container restart.
I have seen I can use eager instantiation of beans. This works for my beans, but actually most of time spent in initialisation are from Quarkus dependencies (in order: vert.x/http stuff, OIDC, Panache/Hibernate). I tried to add these dependencies in a @Startup method, but this look dirty and is inefficient as I don’t know which beans to create to have a correct initialisation of these dependencies.
The best I have found for now is to add a HTTP call to some actual endpoints on first health-check call. In this case, the first HC call initialise everything and only when it’s done, the container is flagged as "ready".
Do you see a better way to achieve the goal "the first call on a 'ready' Quarkus container must be as reactive as all other ones"?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
As far as I understand, Quarkus and all its modules (OIDC handling, Panache…) are designed for lazy initialisation. This has a lot of advantages but leads to slow "first access" (very first request can take more than a second; first access to any endpoint is way slower than consecutive ones).
I have a case in where all my requests must responds quick, event after a container restart.
I have seen I can use eager instantiation of beans. This works for my beans, but actually most of time spent in initialisation are from Quarkus dependencies (in order: vert.x/http stuff, OIDC, Panache/Hibernate). I tried to add these dependencies in a
@Startup
method, but this look dirty and is inefficient as I don’t know which beans to create to have a correct initialisation of these dependencies.The best I have found for now is to add a HTTP call to some actual endpoints on first health-check call. In this case, the first HC call initialise everything and only when it’s done, the container is flagged as "ready".
Do you see a better way to achieve the goal "the first call on a 'ready' Quarkus container must be as reactive as all other ones"?
Thank you in advance!
Beta Was this translation helpful? Give feedback.
All reactions