简体   繁体   English

PHP ODBC不关闭连接

[英]PHP ODBC Not Closing Connections

I have a PHP application that uses the ODBC functions for database access. 我有一个使用ODBC函数进行数据库访问的PHP应用程序。 My DBA recently discovered that the application is not closings its database connections, resulting in numerous invalid connections that are in a TIME_WAIT state. 我的DBA最近发现该应用程序没有关闭其数据库连接,从而导致许多处于TIME_WAIT状态的无效连接。

We have checked the code and I am doing an odbc_close_all call in every script, plus even if I wasn't then the connection should close at the end of the script anyway. 我们已经检查了代码,我在每个脚本中都进行了odbc_close_all调用,即使我不是这样,连接也应该在脚本末尾关闭。 There are no long running scripts holding on to their connections 没有长时间运行的脚本保持它们的连接

Has anyone seen anything like this or have any idea what the issue might be? 有没有人看到过这样的东西,或者不知道可能是什么问题?

PHP version is 5.1.4 Running on Windows Server 2003 R2 Service Pack 2 MySQL database PHP版本为5.1.4,在Windows Server 2003 R2 Service Pack 2 MySQL数据库上运行

After much research, we stumbled upon several sources that indicated that the issue was TcpTimedWaitDelay (thanks VolkerK for the tip). 经过大量研究,我们偶然发现了多个消息源,这些消息表明问题出在TcpTimedWaitDelay (感谢VolkerK提供的技巧)。 This has helped a good deal, but we are still seeing about 30-40 connections in the TIME_WAIT state at any given time. 这提供了很多帮助,但是在任何给定时间,我们仍然可以看到大约30-40个连接处于TIME_WAIT状态。

We are wondering now if anyone has any advice as to whether this behaviour is normal for a Windows Server and if this is as good as it gets, or if there are other avenues worth researching. 现在,我们想知道是否有人对Windows Server的这种行为是否正常以及它是否达到预期提供了任何建议,或者是否还有其他值得研究的途径。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM