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
mssql_connect fails under heavy load
Moderator: General Moderators
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
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...
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...