Advertisement

04.21.2008 at 08:15AM PDT, ID: 23339823
[x]
Attachment Details

Slow ODBC connection from PHP through IIS to Sql Sever 2005

Asked by jmelcher in MS SQL Server, PHP and Databases

Tags: Microsoft/PHP/IIS, Sql Sever 2005, PHP Version 5.2.3, IIS 6.0

I am having some difficulty locating the cause of php webpages loading slowly through IIS. The php code uses several select statements with no joins. I think I have isolated the problem to communication with sql server from the php odbc connection. It seems some others have had similar issues so I have tried the following: changing the output buffering in php to On (it was previously on, but at 4096), and trying to pass odbc_connect different pointer types(this did show a small speed improvement, but nothing significant).

We have tried 2 different sql servers, and both remain at 50% cpu utilization for 20 to 30 minutes while the webpage loads. It does eventually load, but it seems to be taking quite a lot of time. The IIS server never goes about 5%, so this leads me to believe that the sql server is not responding as fast as I would like.

I would like to avoid changing from odbc to some other connection method since I have written all of my php using odbc functions. Below is the connection string I use to connect to sql from php(I used tried SQL_CUR_USE_ODBC but this caused some problems with the odbc_fetch_row() function )

An additional piece of information (I am using port 5050 on IIS, instead of 80(we currently have another website running on 80), but I can see no reason why this should effect the connection to sql)

Thanks in advance for the help.
Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function connect(){
 
$connection_string = 'DRIVER={SQL Server};SERVER=[server name];DATABASE=[database name]'; 
 
$user = 'xxx'; 
$pass = 'xxxxx'; 
 
$connection = odbc_connect( $connection_string, $user, $pass,SQL_CUR_USE_DRIVER );
 
return $connection;
 
}
[+][-]04.21.2008 at 09:13AM PDT, ID: 21403386

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 10:41AM PDT, ID: 21404178

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 10:46AM PDT, ID: 21404226

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 10:52AM PDT, ID: 21404303

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 11:07AM PDT, ID: 21404444

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 11:13AM PDT, ID: 21404487

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 11:18AM PDT, ID: 21404524

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 11:23AM PDT, ID: 21404557

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 01:55PM PDT, ID: 21405935

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.21.2008 at 07:45PM PDT, ID: 21407823

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, PHP and Databases
Tags: Microsoft/PHP/IIS, Sql Sever 2005, PHP Version 5.2.3, IIS 6.0
Sign Up Now!
Solution Provided By: Xyptilon2
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628