-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Open
Labels
kind/enhancementCategorizes a PR related to an enhancementCategorizes a PR related to an enhancementstatus/triageteam/sre
Description
Description
Keycloak starts up well below 10 seconds, when you run the "build" phase before, and only have the optimized startup.
Can we get this well below 4 seconds in those setups where the database was already initialized?
Some ideas:
- Concurrent initialization of the Keycloak factories - see "Details" for a patch idea
- Move ISPN serviceloader moved to build phase similar to
org.keycloak.marshalling.Marshalling - CDS, or JDK25 AOT feature - didn't seem to make much of an impact for startup time for me
Value Proposition
- If we can provide a fast startup of Keycloak, people would be more willing to accept an active/standby setup
Goals
- Bring the startup (well) below 4 seconds
- Focus on implementing smaller changes now, and identifying bigger changes for the future
- It is OK to make fast for JDK25, while other JDKs show the same performance as before.
Non-Goals
- Doing major refactorings for KC 26.6
Discussion
No response
Notes
Ideally we would use virtual threads here to avoid the cost of thread creation during startup, and limiting the parallelization to the number of CPU cores: parallelize_factory_startup.patch
Some things moved to be more eager so they initialize in parallel. This needs more love to make it work also on JDK17+JDK21 and possibly to avoid "synchronized".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
kind/enhancementCategorizes a PR related to an enhancementCategorizes a PR related to an enhancementstatus/triageteam/sre