ID: 29074 Updated by: [EMAIL PROTECTED] Reported By: david dot blair at nsi1 dot com -Status: Open +Status: Feedback Bug Type: MSSQL related Operating System: MS 2003 PHP Version: 4.3.7 New Comment:
You can set the number of allowed connections to the server in php.ini. The default value is 25. mssql.max_procs = 25 Previous Comments: ------------------------------------------------------------------------ [2004-07-09 16:12:46] david dot blair at nsi1 dot com Description: ------------ This is related to bug 19541 http://bugs.php.net/bug.php?id=19541 (mssql_connect fails under stress) When mssql_connect is being used heavily it will automatically fail and return "Unable to connect to server:" instantaneously. We've had this issue on PHP 4.3.6 and last nights current stable build of 4.3.7 when we attempted upgrading to fix the issue. I'm certain this is a problem with php_mssql.dll and however it interacts with ISAPI. We are using Apache 1.3.29 on a Windows 2003 server. Our database is Microsoft SQL 2003 sp3. It is running on the server above. Our development server is also running Windows 2003 with Apache 1.3.29. It will produce the same error under heavy load connecting to the SQL database on the production server. This tells me the SQL server can be local or remote and still have this problem. I would say this is a PHP problem, except that it stays stable and only severely degrades when the SQL server is under stress. On the opposite side of that, I'd say it's a Microsoft SQL server problem except that when PHP is to the point of never being able to connect, programs like Enterprise Manager and Query Analyzer work fine. So I'm guessing it's a joint problem between the two, but it only shows up when PHP is running as an ISAPI module. (we switched from fast cgi and iis to apache and isapi 3 months ago to get away from Bug #25863 IIS: The specified CGI application misbehaved) For three months I've had this problem, but it would only happen say once or twice a week. I put in a failover code to immediately send another mssql_connect if the first one failed and to email me that a double attempt occurred. So it was buggy but easily worked around. Yesterday the entire system fell apart on me. Constant failover to where it wasn't connecting. Hence this bug report. Our system is a web interface project management system for techs in the field that has about 15 people at any given time interacting with it. The SQL server itself runs this system and three reporting systems as well. What gets me is that it will instantly return the message: "Unable to connect..." it's like it's not even trying to connect, it's not like a 60 second timeout where it can't find the server...it's an instantaneous return. The system was already unstable when we tried it, but we tried switching over to mssql_pconnect instead of mssql_connect on the development server and we experienced the same issue. It makes me wonder how pconnect and connect are routed in php_mssql.dll I've seen comments like this one (pulled from bug page 19541): "The Microsoft Library (dblib) used for the mssql extension is not thread safe." but no other information about the mssql extension and how it uses the dblib exists. If anyone can get me information on how to help out on fixing this extension issue, email me! Because I'm more than willing to drop my time into this problem. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29074&edit=1