我有一台 mysql5.0 服务器,验证数据库请求的速度非常慢。在几个请求之后,进程积压,显示等待登录:
| Id | User | Host | db | Command | Time | State | Info |
+----+----------------------+--------------------+------+---------+------+-------+------------------+
| 1 | root | 192.168.1.15:51725 | ouw | Query | 0 | NULL | show processlist |
| 13 | unauthenticated user | 192.168.1.4:47782 | NULL | Connect | NULL | login | NULL |
| 14 | unauthenticated user | 192.168.1.4:47783 | NULL | Connect | NULL | login | NULL |
| 15 | unauthenticated user | 192.168.1.4:47784 | NULL | Connect | NULL | login | NULL |
| 16 | unauthenticated user | 192.168.1.4:47785 | NULL | Connect | NULL | login | NULL |
| 17 | unauthenticated user | 192.168.1.4:47786 | NULL | Connect | NULL | login | NULL |
| 18 | unauthenticated user | 192.168.1.4:47787 | NULL | Connect | NULL | login | NULL |
| 19 | unauthenticated user | 192.168.1.4:47788 | NULL | Connect | NULL | login | NULL |
| 20 | unauthenticated user | 192.168.1.4:47789 | NULL | Connect | NULL | login | NULL |
| 21 | unauthenticated user | 192.168.1.4:47790 | NULL | Connect | NULL | login | NULL |
| 22 | unauthenticated user | 192.168.1.4:47791 | NULL | Connect | NULL | login | NULL |
| 23 | unauthenticated user | 192.168.1.4:47792 | NULL | Connect | NULL | login | NULL |
| 24 | unauthenticated user | 192.168.1.4:38101 | NULL | Connect | NULL | login | NULL |
| 25 | unauthenticated user | 192.168.1.4:38102 | NULL | Connect | NULL | login | NULL |
| 26 | unauthenticated user | 192.168.1.4:38103 | NULL | Connect | NULL | login | NULL |
| 27 | unauthenticated user | 192.168.1.4:38104 | NULL | Connect | NULL | login | NULL |
| 28 | unauthenticated user | 192.168.1.4:38105 | NULL | Connect | NULL | login | NULL |
...
等等。最早的连接会慢慢断开,但如果连接过多,请求者最终会超时。进程列表条目会在表中保留相当长一段时间。就好像一次只有一个线程可以进行身份验证。
服务器崩溃并重新启动。我仔细检查了数据库凭据,并对 mysql 和 wordpress 数据库运行了 myisamchk -f。(除了未正确关闭表之外没有其他错误)
什么原因可能导致这种放缓?
答案1
看看 DNS 是否正常工作。在我看来,mysql 会尝试反向查找客户端 IP。如果超时(UDP),则可能导致此类影响