2

Approximately for standalone start as java process :

java -jar myspring_boot.jar

it takes around 20 seconds. But if I run it in a docker container which contain more micro services it takes around 3 minutes. Is there a way to speed up the spring-boot boot time as for an example if I enable debug longing I notice that there are a lot of unnecessary validations for different spring configurations. How I can speed up the spring-boot startup time only for dev purpose using Docker containers?

Jordan Borisov
  • 1,603
  • 6
  • 34
  • 69

1 Answers1

4

I installed haveged daemon as it says in many answers out there, for example:

https://stackoverflow.com/a/39461346/2748325

And also added -XX:MaxMetaspaceSize=128m to my java CMD in the Dockerfile and the times went down in about 2 minutes.

Community
  • 1
  • 1
Natalia C
  • 346
  • 3
  • 8