简体   繁体   中英

PHP ODBC Not Closing Connections

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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