Saturday, August 10, 2024

Java application performance issue on Tomcat

Symptoms:

Each request delay 15 seconds 

Issue:

Tomcat上的java程序会调用CheckHttpEMPSID.execute()方法,该方法会调用getLocalHost()方法尝试解析本机主机名对应的地址, 当hosts文件中没配置对应的记录时,请求会通过dns对外发起解析, 当dns请求解析超时的情况下会造成java程序阻塞住。

Solution:

Vi /etc/hosts - add Server IP and hostname

E.g. 192.168.8.8 server01

Print Friendly and PDF
Share/Bookmark

No comments:

Post a Comment