Tomcat启动时Creation of SecureRandom instance for session ID很慢

Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [112,140] milliseconds.

主要时间都花在Creation of SecureRandom instance上了。

网上所说的

打开$JAVA_HOME/jre/lib/security/java.security这个文件,找到下面的内容:
        securerandom.source=file:/dev/urandom
    替换成    

        securerandom.source=file:/dev/./urandom

    然而还是没有解决我的这个问题。

最后仔细检查了下,发现$JAVA_HOME/jre/lib/security/java.security中用的是file:/dev/random!前面少了个u!!

所以上面的解决办法没生效就很正常了,改成file:/dev/urandom后,然后在重写部署一次项目启动就OK了!

原文地址:https://www.cnblogs.com/lhd1998/p/13370854.html