We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
开始并发量比较大,达到maxConns最大连接数,然后并发量逐渐减少,但mysql连接不会减少到spareConns。
并发量逐渐减少,但mysql连接会减少到spareConns
并发量维持在最大连接数,不会减少 ...
看代码看到只有客户端连接断开和连接池销毁时候,才根据maxSpareConns和maxSpareExp决定是否释放mysql连接, 并且$spareConns使用数组,使用时pop, 回收时相当于push,每次都使用数组尾端连接。 后面业务量减少的时候,只操作数组尾,没有达到 maxSpareExp, 不会释放。 需要定时检测每个mysql连接使用情况,超过maxSpareExp不用就释放 ...
The text was updated successfully, but these errors were encountered:
mysql每过一段时间会自动断开空闲连接,目前主要是靠mysql 自动断开机制实现的回收。 之前有考虑过定时器 后面发现配合mysql 自动断开会更加高效。
Sorry, something went wrong.
那是服务器设置空闲连接时间,如果服务器设置8小时,这么长时间保持空闲连接,比较浪费。 定时间只是检查一下空闲连接的最后连接状态,应该不会消耗什么性能
好的,谢谢你的建议 后续可以会修复这个问题。
No branches or pull requests
Describe Your Environment (描述你的环境)
How to Reproduce the Problem? (如何重现问题)
开始并发量比较大,达到maxConns最大连接数,然后并发量逐渐减少,但mysql连接不会减少到spareConns。
Expected Behavior (预期行为)
并发量逐渐减少,但mysql连接会减少到spareConns
Actual Behavior (实际行为)
并发量维持在最大连接数,不会减少
...
More Information (更多信息)
看代码看到只有客户端连接断开和连接池销毁时候,才根据maxSpareConns和maxSpareExp决定是否释放mysql连接, 并且$spareConns使用数组,使用时pop, 回收时相当于push,每次都使用数组尾端连接。 后面业务量减少的时候,只操作数组尾,没有达到 maxSpareExp, 不会释放。
需要定时检测每个mysql连接使用情况,超过maxSpareExp不用就释放
...
The text was updated successfully, but these errors were encountered: