Page 1 of 1

mssql_connect fails under heavy load

Posted: Mon Dec 06, 2004 9:06 am
by snicolas
I have a strange behaviour happening since Friday.

I use mssql_connect to connect to my db on every page.
My code looks like this:
<?php
@session_start();
include("checkconnection.php"); //just checking if connection is there
include("settings.php");//include settings conenction
$sql = new mod_db();
?>
Here i do my select etc..
<?include("closeconnection.php");//close conenction?>

My connection connect to the remote machine properly and to my DB most of the time, but sometimes (since Friday), i get a connection error message looking like that:

Warning:mssql_connect_db():Unable to connect to database "MyDB".

I cannot understand why iut started doing this as no major changes have been made to the code.

Spomebody got an idea?

s

Posted: Tue Dec 07, 2004 2:41 am
by snicolas
Anybody has an answer?
How to check the different connection to the mssql server?

thanx

S

Posted: Tue Dec 07, 2004 3:01 am
by rehfeld
if your sure you havent changed anything, id ask your host

Posted: Tue Dec 07, 2004 3:23 am
by snicolas
trouble, is that i am my own host!

Posted: Tue Dec 07, 2004 3:24 am
by patrikG
check the network infrastructure.

Posted: Tue Dec 07, 2004 3:35 am
by snicolas
What do you mean network infrastructure??
I checked the SQL process, and there is no overload.

Posted: Tue Dec 07, 2004 5:26 am
by snicolas
What is the big difference between:
mssql_connect or mssql_pconnect

I understand mssql_pconnect creates a persistent connection and will not open a new one if one is already opne.
Which one to use to make the application as stable as possible?

s

Posted: Tue Dec 07, 2004 8:37 am
by Maugrim_The_Reaper
If you are your own host - you'll need to delve into your mysql config. There are a few tutorials around on how to optimise mysql to get the most connections/stability under heavy usage. Google is your first stop...:)

In my experience - leave out persistent connections. Most mention of them states they help with heavy use - but if your maximum connections are low... Disaster...:)