PHP ODBC Not Closing Connections

让人想犯罪 __ 提交于 2019-12-12 01:19:02

问题


I have a PHP application that uses the ODBC functions for database access. 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.

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. 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


回答1:


After much research, we stumbled upon several sources that indicated that the issue was TcpTimedWaitDelay (thanks VolkerK for the tip). This has helped a good deal, but we are still seeing about 30-40 connections in the TIME_WAIT state at any given time.

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.

Thanks



来源:https://stackoverflow.com/questions/3523500/php-odbc-not-closing-connections

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!