3

This is a weird problem.

We are using spring boot web application with integrated tomcat.

On my local mac, the app startup quickly.. several seconds. On google machine with Centos 7, it starts very slowly.. about 2 minutes.

Application is written in JAVA 8

Can anyone help?

Ido Barash
  • 4,856
  • 11
  • 41
  • 78
  • 3
    Are you using Tomcat? It could be a lack of entropy causing it to block. See http://stackoverflow.com/questions/25660899/spring-boot-actuator-application-wont-start-on-ubuntu-vps/25669300#25669300 for more details. – Andy Wilkinson Aug 03 '15 at 16:49
  • 2
    Hi did you solve this problem? I have a similar problem with Google Cloud, but the weird thing is: In the first boot, it is fast. If I kill the process (CTRL+C) and then try to start again, it takes 5 minutes to startup. Very strange behavior. – leozin Mar 23 '16 at 00:18
  • 2
    The answer from @AndyWilkinson worked for me: sudo apt-get install haveged -y – leozin Mar 23 '16 at 00:25

2 Answers2

5

This is a community wiki answer, provided by @AndyWilkinson

Are you using Tomcat? It could be a lack of entropy causing it to block. See Spring Boot Actuator application won't start on Ubuntu VPS for more details.

and @leozin:

Try installing haveged: sudo apt-get install haveged -y

Community
  • 1
  • 1
alexbt
  • 16,415
  • 6
  • 78
  • 87
  • Starting from Linux kernel v5.4, the HAVEGED inspired algorithm has been included in the Linux kernel making Haveged obsolete. https://github.com/jirka-h/haveged/blob/master/README.md – Sergey Sep 15 '22 at 21:01
0

I agree that haveged improves the startup time.

In my case (also Centos 7 but docker containerized), I had to add some -XX:MaxMetaspaceSize and the startup times went down in about 2 minutes.

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Natalia C
  • 346
  • 3
  • 8