dylanrolfey Posted July 4, 2008 Share Posted July 4, 2008 Hi everyone, I keep getting this error coming up: PHP Warning: mssql_connect() Unable to connect to server: localhost,2168 However it seems that it is only coming up when there is a heavy load on the server. To explain, I have setup a PHP page which runs a small C# app that is multithreaded, which runs about 80 threads simultaneously, each one loading a PHP page which connects to the database. When I run it I get about 20 errors saying that it is unable to connect. I have done some tests and it seems to run fine if I only have about 30 threads running, but if I run 2 windows (ie 60 threads) it produces errors. Here is my php.ini file relating to MSSQL: [MSSQL] ; Allow or prevent persistent links. mssql.allow_persistent = Off ; Maximum number of persistent links. -1 means no limit. mssql.max_persistent = -1 ; Maximum number of links (persistent+non persistent). -1 means no limit. mssql.max_links = -1 ; Minimum error severity to display. mssql.min_error_severity = 10 ; Minimum message severity to display. mssql.min_message_severity = 10 ; Compatibility mode with old versions of PHP 3.0. mssql.compatability_mode = Off ; Connect timeout mssql.connect_timeout = 10 ; Query timeout mssql.timeout = 30 ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textlimit = 4096 ; Valid range 0 - 2147483647. Default = 4096. ;mssql.textsize = 4096 ; Limits the number of records in each batch. 0 = all records in one batch. mssql.batchsize = 0 ; Specify how datetime and datetim4 columns are returned ; On => Returns data converted to SQL server settings ; Off => Returns values as YYYY-MM-DD hh:mm:ss ;mssql.datetimeconvert = On ; Use NT authentication when connecting to the server mssql.secure_connection = Off ; Specify max number of processes. -1 = library default ; msdlib defaults to 25 ; FreeTDS defaults to 4096 mssql.max_procs = -1 ; Specify client character set. ; If empty or not set the client charset from freetds.comf is used ; This is only used when compiled with FreeTDS ;mssql.charset = "ISO-8859-1" My setup is: Windows Server 2003 SP2 SQL Server 2005 Express PHP 5.2.0 IIS 6 Using the ntwdblib.dll extension I assume that MSSQL can handle much more than 60 simultaneous connections to the database, and PHP looks like it is not limiting the connections either. Is there something else vital I am missing in this whole thing? Any help is much appreciated, thanks Dylan Quote Link to comment https://forums.phpfreaks.com/topic/113166-connection-problems/ Share on other sites More sharing options...
nyonline Posted July 7, 2008 Share Posted July 7, 2008 hey i am getting the same error too.. Did you find any solution for the same? Quote Link to comment https://forums.phpfreaks.com/topic/113166-connection-problems/#findComment-583322 Share on other sites More sharing options...
dylanrolfey Posted July 7, 2008 Author Share Posted July 7, 2008 No, as such still am having problems. And now I have fears that if my website does get some serious traffic, my setup will not be able to handle it. I don't know if this is common or not ??? but it sucks lol Quote Link to comment https://forums.phpfreaks.com/topic/113166-connection-problems/#findComment-583326 Share on other sites More sharing options...
dylanrolfey Posted July 18, 2008 Author Share Posted July 18, 2008 OK so just to let everyone know the FastCGI module worked great. Same test, no errors! Hooray. Pretty simple to install once you get your head around it. I just followed this and it worked great. http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/ Dylan Quote Link to comment https://forums.phpfreaks.com/topic/113166-connection-problems/#findComment-592957 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.