Crowd startup takes an extremely long time on Linux
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When first starting Crowd it takes an extremely long time to start up (up to an hour).
The following appears in the catalina.out
1
2
3
4
Jul 08, 2015 3:08:22 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [3,599,693] milliseconds.
Jul 08, 2015 3:08:22 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deployment of configuration descriptor /opt/atlassian/crowd/apache-tomcat/conf/Catalina/localhost/openidserver.xml has finished in 3,613,735 ms
Diagnosis
Environment
Oracle Java installed in a Unix/Linux environment
Tomcat 7
Diagnostic steps
Run the following from the command line
head -n 1 /dev/random
If the command does not return immediately, use the steps below to configure the JVM to use
/dev/urandom instead of /dev/random
Cause
There is a known issue with Java and Tomcat in he library used for random number generation in Sun's JVM which relies on /dev/random. This
random number generator can block the application server process from starting 'because on some operating systems /dev/random
waits for a certain amount of "noise" to be generated on the host machine before returning a result' (see Avoiding JVM Delays Caused by Random Number Generation).
Workaround
Stop Crowd
Update
java.security
fileFor Java 8, open the
$JAVA_HOME/lib/security/java.security
file in a text editorFind the line:
securerandom.source=file:/dev/random
Change it to read:
securerandom.source=file:/dev/urandom
For Java 11+, open the
$JAVA_HOME/conf/security/java.security
file in a text editorFind the line:
securerandom.source=
file:/dev/random
Change it to read:
securerandom.source=
file:/dev/urandom
Save your change and exit the text editor
Start Crowd
Was this helpful?