tomcat加载java程序非常慢解决


解决:

下面两种方式都要添加上,速度会很快,启动妙级的


1)在Tomcat环境中解决

可以通过配置JRE使用非阻塞的Entropy Source。

在catalina.sh中加入这么一行:

JAVA_OPTS="-Djava.security.egd=file:/dev/./urandom"

即可。

加入后再启动Tomcat,整个启动耗时迅速下降。

2)在JVM环境中解决

find / -name java.security


打开$JAVA_PATH/jre/lib/security/java.security这个文件,找到下面的内容:

securerandom.source=file:/dev/urandom
替换成
securerandom.source=file:/dev/./urandom


实例:

[root@host-10-1-1-103 tomcat]# find / -name java.security
[root@host-10-1-1-103 bin]# find / -name java.security
/usr/local/jdk/jre/lib/security/java.security
/usr/local/jdk/jdk1.8.0_171/jre/lib/security/java.security


3、mysql数据看的max_connection 连接数调大即可解决调到1000

原文地址:https://www.cnblogs.com/effortsing/p/10013649.html