Mysql show processlist列出了许多进程睡眠,而info = null? [英] Mysql show processlist lists many processes sleep and info = null?
问题描述
我正在将压力测试注入连接到mysql服务器的Web应用程序中,并且正在监视mysql的显示进程列表.
I'm injecting a stress test into my web app that connects to a mysql server and I'm monitoring the show processlist of mysql.
当负载很高(高交换I/O)时,我会得到许多类似的过程:
When the load is high (high swap i/o) I get many processes like that:
| 97535 | db| localhost | userA | Sleep | 515 | | NULL
| 97536 | db| localhost | userA | Sleep | 516 | | NULL
| 97786 | db| localhost | userA | Sleep | 343 | | NULL
| 97889 | db| localhost | userA | Sleep | 310 | | NULL
但是我不明白为什么他们仍然在那里并且没有被杀死?最终导致我的应用使用所有max_connections并停止处理传入的请求...
But I can't understand why are they still there and are not killed? This eventually leads to my app using all max_connections and stop processing incoming requests...
任何想法,这些过程是什么,它们在做什么:)?
Any idea what are those processes and what are they doing there :) ?
推荐答案
那些是客户端保留的空闲连接.您应该确保将正在使用的任何客户端库(JDBC,...)配置为不会长时间保持未使用的连接打开,或者确保您的#个客户端*最大连接数不是太大.
Those are idle connections being held by a client. You should make sure that whatever client library you are using (JDBC, ...) is configured to not keep unused connections open so long, or that your # clients * max # of connections isn't too big.
这篇关于Mysql show processlist列出了许多进程睡眠,而info = null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!