What to Do If Tomcat Is Taking an Exceedingly Long Time to Start

JFrog Support
2023-01-22 11:05

Normally, when the only application that is running in it is Artifactory, Tomcat will start within 10-40 seconds.

If your Tomcat takes longer to start, it may be due to the random number generator that it is using. You might want to consider forcing it to use '/dev/urandom' rather than the default '/dev/random' that Tomcat uses.

'/dev/random' is a random number generator often used to seed cryptographic functions for better security.

'/dev/urandom' likewise is a (pseudo) random number generator. Both are good at generating random numbers. The key difference is that '/dev/random' has a blocking function that waits until entropy reaches a certain level before providing its result. From a practical standpoint, this means that applications using '/dev/random' will generally take longer to complete than '/dev/urandom'.

In order to force Tomcat to use '/dev/urandom' just add -Djava.security.egd=file:/dev/./urandom to the JAVA_OPTS parameter on the startup script.