Tencent cloud ubuntu server tomcat access slow reason analysis and solution

  • 2020-05-10 23:23:55
  • OfStack

On tencent cloud with a 1 yuan student cloud, began 1 cut normal, until the configuration of tomcat began to appear all kinds of puzzling problems. The most baffling thing was that tomcat was started, the ports were listening properly, the security group was releasing the ports, and then there was the problem.

If you visit the tomcat home page with a browser, you will find it is super slow. Browser 1 is waiting for the response from the server. It can be seen from here that it can access port 8080, but the server has not returned any data. (a few days of agonizing over the problem)

Later on the Internet to find countless information, finally found the reason. tomcat8.0 has bug on tencent cloud ubuntu14.04.

Reasons for the problem:

Random Numbers cause threads to block.

tomcat starts, closes, starts and closes. A few times later, you get stuck. It takes a long time to load

Ali cloud same configuration, the same system, it is difficult to appear stuck. The   is released even after a few 10 seconds. And tencent cloud ubuntu will not tencent cloud centos do not know.

Multiple startup and shutdown, generating random Numbers when the thread block, and then stuck.

Solutions:

tomcat bin/ catalina.sh added


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

Related articles: