Groups | Blog | Home
all groups > sql server (microsoft) > january 2007 >

sql server (microsoft) : large SP performance difference between identical servers


Bob Speaking
1/25/2007 11:56:07 PM
Hi at all,
first post in this NG (i usually walk around .net programming ng :P )

I've decided to write cause I have a strange (Strange for me.. I'm a
beginner with sql server).

well...too words....i go directly to question :

I have 2 sql server installed on 2 identical machines (same cpu, same disk
and ram).
The first is the production database server and the second is for tests and
development.

On development server there is one stored procedure that is extremely slower
than the twin stored procedure on the other machine.
The table referred is the same, same data. (about 20000 records with 1 inner
join).

I've checked out indexes (I've also rebuilt indexes) and sql server
configuration but I don't find any differences.
Why one is faster than the second? (the "good" SP twin takes about 5 seconds
to run..and the second takes about 1 minute)

Where I must focalize my attention? Where can be the problem?
(the development server is more "stressed"...I restore and backup database
very often)

Thanks in advance,
Bob


Ed Murphy
1/26/2007 8:35:35 AM
[quoted text, click to view]

Perhaps the production server has the data already cached in RAM. Try
running the SP on the development server twice in a row - is the second
sriram
1/29/2007 8:42:09 PM
[quoted text, click to view]

Hi,

Maybe, you could do the following two things

1. running DBCC FREEPROCCACHE
2. running the proc with recompile

and i feel everything will be clear.

Regards,
Sriram
Russ Rose
2/5/2007 10:28:12 PM

[quoted text, click to view]

A ten-fold difference is usually the difference between accessing memory vs
disk drive.

Assuming data/procedure cache doesn't explain the difference, it is
important to know that SQL Server is capable of "self-tuning". Over a period
of operation it learns what the standard workload is and it adjusts internal
operating parameters to best serve the given workload.

Another thing to look at is fragmentation, both of the physical disk as well
as the pages/extents that make up the database. If there are no files other
than the database on the data drive, try formatting the test server
partition to get a clean directory structure prior to a restore.

Finally you may want to look at the query plan and/or trace of your query on
both servers and look for obvious differences in the execution.



Bob Speaking
2/9/2007 10:27:57 PM
Thanks at all for the suggestions!

You are always in right...

1) clearing the PROCCACHE has slowed down the production server reporting
it's performance more near to the development server. But it was still
remain difference...

2) The disk of development server was in bad condition...I successfully
learned that every night on production server run a defrag utility. The
development server was very defragmented.

Now the performances of the two servers are very near. The production server
still remains a bit faster than dev.
As I read can be the selftuning of mssql :)

I didn't know about selftuning...I think it's powerful. It's the same
mechanism of "tuning wizard" I suppose.


Well...
thanks again.


Bob


AddThis Social Bookmark Button