1. 程式人生 > >Tomcat啟動時Creation of SecureRandom instance for session ID很慢

Tomcat啟動時Creation of SecureRandom instance for session ID很慢

host ces security random Nid tom str local dev

啟動tomcat很慢,檢查後發現:
[localhost-startStop-1]
org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [131,830] milliseconds。

主要時間都花在Creation of SecureRandom instance上了

解決辦法:

先檢查$JAVA_HOME/jre/lib/security/java.security中用的file:/dev/./random!是否前面少了個u!!如果是

,改成file:/dev/urandom後,重啟tomcat,sucess。

Tomcat啟動時Creation of SecureRandom instance for session ID很慢