tomcat启动时候发现很慢,其中有如下日志,消耗了大部分的时间 org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [108,623] milliseconds.
修改配置文件bin/catalina.sh
里面找到JAVA_OPTS="$JAVA_OPTS $JSSE_OPTS"
加入-Djava.security.egd=file:/dev/./urandom
即可
修改完如下格式:
JAVA_OPTS="$JAVA_OPTS $JSSE_OPTS -Djava.security.egd=file:/dev/./urandom"