1

tomcat启动慢解决办法

 2 years ago
source link: https://wakzz.cn/2018/02/23/tomcat/tomcat%E5%90%AF%E5%8A%A8%E6%85%A2%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

tomcat启动慢解决办法

祈雨的博客
2018-02-23

部分linux环境下启动tomcat会非常慢,可通过以下方法解决该问题:
修改${JAVA_HOME}/jre/lib/security/java.security文件的securerandom.source参数如下

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

tomcat启动时,需要一个随机数生成sessionID,默认随机数为Linux的真随机数。
而Linux的真随机数存在于随机数池中且真随机数生成非常慢。当随机数池的随机数用完后,tomcat则阻塞等待Linux生成真随机数,导致tomcat启动非常慢。
解决办法之一则是如上的将java的随机数由真随机数改为伪随机数即可。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK