Forum Moderators: coopster

Message Too Old, No Replies

Occassional Problem using MSSQL_PCONNECT

         

westireland

2:41 pm on Feb 1, 2006 (gmt 0)

10+ Year Member



I am having intermitant problems connectng using mssql_pconnect. everyting works fine for a while then I start to get failed connections. restarting IIS makes the problem go away for a time again, then it starts up all over again.
code is stratightforward
$dbh = mssql_pconnect("Server","user","pass");

The site wouldnt have a huge load on it.

Anyone come accross this before.

thanks

Birdman

9:21 pm on Feb 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could be that you have too many open connections. Check this comment out, from PHP.net:

Please note that mssql_pconnect creates a connection for the pool for *each process*. If you have "ThreadsPerChild" set to 50 in apache, and mssql.max_procs set to 25 in php, then eventually you will get mssql_pconnect failing to give you a connection to the database. This has stumped me for quite a while, and the answer finally presented itself thanks to the people in #php

You could try using mssql_connect() instead.

Oh yeah, welcome to the boards!

westireland

9:48 am on Feb 2, 2006 (gmt 0)

10+ Year Member



Thanks. I have the mssql.max_procs set to 100 for a while now but it didnt seem to make any difference. I have been looking around for an answer to this for a while. I think I might have to switch to mssql_connect alright. Seems that there may be some general problem with using mssql_pconnect as I have heard of a few people having the problem but no one seems to have a definite solution.