After starting the tomcat service and entering the Project address, we can find that the page remains in the loading process for several minutes, which cannot be allowed in a normal production environment. Therefore, a corresponding investigation was conducted. The problem may be caused by the number of connections in the mysql connection pool of the project, but the problem persists after the change.
Check whether the connection status of the current mysql instance is correct. Use the mysqladmin-uroot-p processlist command to find the unauthenticated user.
| 327 | unauthenticated user | 192.168.110.39: 50955 | Connect | login |
After checking on the Internet, it is determined that it is a problem of reverse resolution of Mysql DNS. Mysql will try to resolve the IP address to the DNS domain name no matter whether the database is connected through direct IP or domain name connection, currently, applications are directly connected to the database through IP addresses, and Mysql still takes a long time to try to resolve the IP address as a DNS domain name.
Therefore, modify the my. cnf configuration file.
1. Stop mysql
2. modify my. cnf and add skip-name-resolve
3. Start mysql
Restart tomcat to access the Project address-the speed is flying!