473,435 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,435 software developers and data experts.

SQL Express - Slow response time on all but one machine

4
Hello,

I'm working on a web application using Apache (2.0.55), PHP (5.2.8) & SQL Server 2008 Express (using the Microsoft provided php extension php_sqlsrv_52_ts_vc6.dll) and I have a speed problem with SQL Server Express.

On my development machine, everything works fine. But when I setup other computers, the SQL Express takes much longer to respond.

My development machine is a 3GHz Core2 Duo with 1.96 GB RAM and one of my test machine is a 2.66GHz Core2 Duo with 1.99 GB RAM. Could the processor speed difference be the sole source of this slowness?

Using a profiler (SQL Server 2005/2008 Express Profiler), I can see that most of the SQL events are "exec sp_cursor" & "exec sp_cursorfetch" (I use SELECT statements in my PHP). On the development machine most of these have a duration of 0 (the others have 976); on another machine, the duration varies wildly, but each one is mostly between 30 and 300.

Anybody has some clues as to what could be the cause of this ?
May 4 '10 #1

✓ answered by goozak

Found it !! The problem was twofold:
  1. The PHP code configured the sqlsrv DLL to log EVERYTHING (SQLSRV_LOG_SYSTEM_ALL & SQLSRV_LOG_SEVERITY_ALL) - these get logged in Apache's ErrorLog.
  2. I was using RotateLogs in Apache for our ErrorLog and a CustomLog on my development machine.
The PHP is not my code, I'm starting a new job and the original programmer already left the company. Since it was working fine on my machine, I never thought of looking at the PHP - and these commands were in some dark corner anyway...

As soon as I either comment out the logging lines in PHP or use RotateLogs.exe for my Apache logs, the speed goes way up!

So, if you want to log a lot of stuff in Apache, use RotateLogs!

4 4138
ck9663
2,878 Expert 2GB
Is your SQL Server on your development machine? Another thing, cursor is one of the slowest way to access a table in SQL. Try converting it a set-based query. Once two or more client use your application, a lot of things are going on, including table locking which could look like a slow execution of a particular client.


Good Luck!!!

~~ CK
May 5 '10 #2
goozak
4
Thanks CK for your help. Yeah, everything is on the same machine (SQL Express & Apache). It's a stand alone product that will be installed on a single machine used by a single user. The code base is the same as the corporate, web server version.

I removed most of the cursors from the queries, but with marginal gain in speed. Other SQL events are taking a long time too, like "USE dbName" (duration of 976 on my machine, and 146484 on the other)...

We use TCP/IP to communicate with the SQL Server, a college found something about Named Pipes and a random configuration problem at installation... He had to leave in a hurry, so I'll look into that tomorrow...
May 5 '10 #3
goozak
4
@goozak
Well, still no luck... We tried with TCP/IP, Shared Memory & Named pipes but got the same result. SQL Server is slow on every machine we test on, except my own computer. I even uninstalled SQL Server and reinstalled it - it's still running fine !

Why does Oracle charge so much to include MySQL in our software? We have no speed problem with MySQL... :-(
May 6 '10 #4
goozak
4
Found it !! The problem was twofold:
  1. The PHP code configured the sqlsrv DLL to log EVERYTHING (SQLSRV_LOG_SYSTEM_ALL & SQLSRV_LOG_SEVERITY_ALL) - these get logged in Apache's ErrorLog.
  2. I was using RotateLogs in Apache for our ErrorLog and a CustomLog on my development machine.
The PHP is not my code, I'm starting a new job and the original programmer already left the company. Since it was working fine on my machine, I never thought of looking at the PHP - and these commands were in some dark corner anyway...

As soon as I either comment out the logging lines in PHP or use RotateLogs.exe for my Apache logs, the speed goes way up!

So, if you want to log a lot of stuff in Apache, use RotateLogs!
May 7 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: j askey | last post by:
I have a strange bandwidth issue that I have finally tracked down to something fairly specific if anyone has any ideas... Setup: Win2003 Server, PHP 4.3.4, IIS6.0, ISAPI Network: DSL line with...
9
by: Vito DeCarlo | last post by:
I've been having this problem for a few weeks. PLEASE read this post before responding with some simple reason that has nothing to do with my problem. If you need more information, please request...
3
by: Pavils Jurjans | last post by:
Hello, I am experiencing very slow processing of ASP.NET pages that are served over LAN, while when running them on the server machine (ie http://localhost), there is no slowdowns. We have...
5
by: Ram | last post by:
Hi After deploying a simple web application to the production environment, I see that hwne I launch my app's url it takes a while to load the home page.(it doesnt do anything complex. A pretty...
4
by: Andrew Robinson | last post by:
My main dev machine has WinXp and VS2005 (pro). 1. I need to install VWD Express Edition so that I can do some instruction on this. Any issues with both on the same machine. Installation order?...
10
by: cleo | last post by:
I am migrating from VB6/Access to Visual Basic and SQL Express. I have success writing test code on my local machine and am now setting up tests for deployment to a server. I have installed SQL...
11
by: HC | last post by:
I posted this in one of the VB forums but I'm starting to think it might be more appropriate to have it here, since it really seems to be a SQL server (MSDE/Express 2005) problem: Hey, all, I...
9
by: HC | last post by:
Hello, all, I started out thinking my problems were elsewhere but as I have worked through this I have isolated my problem, currently, as a difference between MSDE and SQL Express 2005 (I'll just...
9
by: SAL | last post by:
I have an ASP.NET 2.0 app that takes about 17 seconds to load on first startup but then is very fast after that. As I understand it from some posts in June, this is caused by the loading of the App...
10
by: Scott M. | last post by:
I've seen many posts and ready articles discussing how changing the membership & roles "provider" in VS .NET is easy, but have yet to see instructions on how to do it. If I already have SQL...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.