Recently, the database has encountered abnormal pauses and blocking, and a large number of connections similar to the following are found through show processlist:
| 592 | unauthenticated user | 192.168.3.20: 35320 | null | connect | login | null |
| 593 | unauthenticated user | 192.168.3.20: 35321 | null | connect | login | null |
| 594 | unauthenticated user | 192.168.3.20: 35322 | null | connect | login | null |
Google found that it is related to domain name resolution.
No matter whether the connection is through the hosts or IP address, MySQL will reverse query the DNS.
MySQL tries to reverse query the IP address> DNS. Because reverse query resolution is too slow or has a problem, it cannot cope with fast multi-volume queries.
Three solutions (the disadvantage of the first two solutions is that the host name cannot be used, but the IP address must be used ):
- Add -- skip-name-resolve to the startup parameters to disable Reverse Domain name resolution.
- Add skip-name-resolve in [mysqld] Of My. CNF.
- Add the corresponding host record to the/etc/hosts file
Currently, 2nd methods are used.
EOF ------