Koppeltaal / KT2-Docker-Compose

Docker compose project that helps to easily spawn the required components for Koppeltaal 2.0. Mainly used for development-purposes.
Mozilla Public License 2.0
0 stars 1 forks source link

Try to improve docker compose startup time #6

Open JorisHeadease opened 1 year ago

JorisHeadease commented 1 year ago

Currently, the spring boot applications take quite a long time to start up. Try to look into low-maintenance solutions that lower this startup time, for example use GraalVM.

JorisHeadease commented 1 year ago

Found out the application startup initialised a GraphQL-related @Bean even though GraphQL was disabled for the project:

Screenshot 2023-07-07 at 14 51 38

After conditionally loading, a new top thread duration is added, but this contains items that have to be performed unlike before, and the load went from 8 seconds to 4 seconds (with the profiler attached):

Screenshot 2023-07-07 at 14 59 44

As for the local startup times without a profiler connected: Before:

  1. 15.053
  2. 15.139
  3. 15.226

After:

  1. 13.26
  2. 13.751
  3. 13.594
JorisHeadease commented 1 year ago

As for further improvements, ideally FHIR HAPI is upgraded to Spring Boot 3, so we can use AOT (Ahead of Time) compilation. I can imagine this taking quite a while though. It would be a major boost to the startup times though. I will check with the FHIR devs if they have plans to implement this anytime soon.

JorisHeadease commented 1 year ago

The Spring upgrade seems to be planned for November '23 (quote below is from the google forms link)

https://chat.fhir.org/#narrow/stream/179167-hapi/topic/Spring.20Boot.203.2E0.2Ex https://github.com/hapifhir/hapi-fhir-jpaserver-starter/pull/473 https://docs.google.com/forms/d/e/1FAIpQLSc5roQSFdPpfDvm0JQ8RI4tVOTV-QgaNdk-Zh0e1rlmR5mP8Q/viewform

The Java EE spec has moved from the javax. package namespace to the new jakarta. namespace. HAPI FHIR will need to migrate to the new API and it is unfortunately not feasible to support both APIs long term. Migrating to the new API will be required in order to use HAPI FHIR with the current release of many popular frameworks including Spring 6, Spring Boot 3, and Hibernate 6. This is a nontrivial change: It will require upgrades to Spring and Hibernate within HAPI FHIR. It will also require HAPI FHIR users to potentially upgrade their application servers, and rework any custom code (e.g. resource providers, interceptors) in order to use the new APIs. Our current working plan is to make this upgrade as a part of our November 2023 release, with early access builds available before that time.