PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HBERGEURS DEVIS FORUMS RDUCTEUR D'URL
Prcdent   PHWinfo > Forums Hbergement > Forum Hbergement serveur > ms.sqlserver.server > Strange behavior – slow performance of first query
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Strange behavior – slow performance of first query

Rponse
 
LinkBack Outils de la discussion
Vieux 18/06/2008, 19h05   #1
Marant
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Strange behavior – slow performance of first query

My MS SQL 2005 very slowly response for every first query after few minutes
of servers inactivity. It doesn’t matter if query is very simple or not, if
return many rows or not, etc. Even simple SELECT on table that contains only
few records takes about 15 seconds.

After this first operation every other queries (even very complicated) runs
very fast (results are always returned in milliseconds).

SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs, 4GB
RAM, etc.) which is not used by any other users, so when this first
“long-time-running-query” is processing the system is basically doing nothing
(utilization of CPU or HDD is almost 0). There is no difference client
application is connected to server from other workstation or query is run in
SQL Management Studio directly on server.

Do you have any ideas what is the reason of this behavior or how to better
trace source of the problem?

  Rponse avec citation
Vieux 18/06/2008, 19h25   #2
Tracy McKibben (http://www.realsqlguy.com)
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Re: Strange behavior slow performance of first query

On Jun 18, 12:05pm, Marant <Mar...@discussions.microsoft.com> wrote:
> My MS SQL 2005 very slowly response for every first query after few minutes
> of servers inactivity. It doesnt matter if query is very simple or not, if
> return many rows or not, etc. Even simple SELECT on table that contains only
> few records takes about 15 seconds.
>
> After this first operation every other queries (even very complicated) runs
> very fast (results are always returned in milliseconds).
>
> SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs, 4GB
> RAM, etc.) which is not used by any other users, so when this first
> long-time-running-query is processing the system is basically doingnothing
> (utilization of CPU or HDD is almost 0). There is no difference client
> application is connected to server from other workstation or query is runin
> SQL Management Studio directly on server.
>
> Do you have any ideas what is the reason of this behavior or how to better
> trace source of the problem?


Do you have the auto-close option enabled for the database in question?
  Rponse avec citation
Vieux 18/06/2008, 19h46   #3
Marant
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Re: Strange behavior – slow performance of first query

No. All setting are default (except Recovery Model is changed to Simple) , so
Auto Close option is set to False.


"Tracy McKibben (http://www.realsqlguy.co" wrote:

> On Jun 18, 12:05 pm, Marant <Mar...@discussions.microsoft.com> wrote:
> > My MS SQL 2005 very slowly response for every first query after few minutes
> > of servers inactivity. It doesn’t matter if query is very simple or not, if
> > return many rows or not, etc. Even simple SELECT on table that contains only
> > few records takes about 15 seconds.
> >
> > After this first operation every other queries (even very complicated) runs
> > very fast (results are always returned in milliseconds).
> >
> > SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs, 4GB
> > RAM, etc.) which is not used by any other users, so when this first
> > “long-time-running-query” is processing the system is basically doing nothing
> > (utilization of CPU or HDD is almost 0). There is no difference client
> > application is connected to server from other workstation or query is run in
> > SQL Management Studio directly on server.
> >
> > Do you have any ideas what is the reason of this behavior or how to better
> > trace source of the problem?

>
> Do you have the auto-close option enabled for the database in question?
>

  Rponse avec citation
Vieux 19/06/2008, 10h41   #4
Ekrem Önsoy
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Re: Strange behavior – slow performance of first query

Have you tried querying your databases locally where this SQL Server
instance is installed? I mean if you are querying your database remotely
from another machine in your network, you could suspect from a network issue
as well.

--
Ekrem Önsoy



"Marant" <Marant@discussions.microsoft.com> wrote in message
news:700F15CB-5AC2-4797-B0F4-2ED6D07D7643@microsoft.com...
> No. All setting are default (except Recovery Model is changed to Simple) ,
> so
> Auto Close option is set to False.
>
>
> "Tracy McKibben (http://www.realsqlguy.co" wrote:
>
>> On Jun 18, 12:05 pm, Marant <Mar...@discussions.microsoft.com> wrote:
>> > My MS SQL 2005 very slowly response for every first query after few
>> > minutes
>> > of servers inactivity. It doesn’t matter if query is very simple or
>> > not, if
>> > return many rows or not, etc. Even simple SELECT on table that contains
>> > only
>> > few records takes about 15 seconds.
>> >
>> > After this first operation every other queries (even very complicated)
>> > runs
>> > very fast (results are always returned in milliseconds).
>> >
>> > SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs,
>> > 4GB
>> > RAM, etc.) which is not used by any other users, so when this first
>> > “long-time-running-query” is processing the system is basically doing
>> > nothing
>> > (utilization of CPU or HDD is almost 0). There is no difference client
>> > application is connected to server from other workstation or query is
>> > run in
>> > SQL Management Studio directly on server.
>> >
>> > Do you have any ideas what is the reason of this behavior or how to
>> > better
>> > trace source of the problem?

>>
>> Do you have the auto-close option enabled for the database in question?
>>


  Rponse avec citation
Vieux 19/06/2008, 11h49   #5
Marant
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Re: Strange behavior – slow performance of first query

Yes, as I said: "There is no difference if client application is connected to
server from other workstation or query is run in SQL Management Studio
directly on server."

I have also find out that delay for first query is always about 45 seconds
long, and that at the same time Event Viewer shows error: Event ID 560
(object access problem for WinHttpAutoProxySvc). I'm trying right now to
google solution for this problem, but changes that already tested did not
...



"Ekrem Önsoy" wrote:

> Have you tried querying your databases locally where this SQL Server
> instance is installed? I mean if you are querying your database remotely
> from another machine in your network, you could suspect from a network issue
> as well.
>
> --
> Ekrem Önsoy
>
>
>
> "Marant" <Marant@discussions.microsoft.com> wrote in message
> news:700F15CB-5AC2-4797-B0F4-2ED6D07D7643@microsoft.com...
> > No. All setting are default (except Recovery Model is changed to Simple) ,
> > so
> > Auto Close option is set to False.
> >
> >
> > "Tracy McKibben (http://www.realsqlguy.co" wrote:
> >
> >> On Jun 18, 12:05 pm, Marant <Mar...@discussions.microsoft.com> wrote:
> >> > My MS SQL 2005 very slowly response for every first query after few
> >> > minutes
> >> > of servers inactivity. It doesn’t matter if query is very simple or
> >> > not, if
> >> > return many rows or not, etc. Even simple SELECT on table that contains
> >> > only
> >> > few records takes about 15 seconds.
> >> >
> >> > After this first operation every other queries (even very complicated)
> >> > runs
> >> > very fast (results are always returned in milliseconds).
> >> >
> >> > SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs,
> >> > 4GB
> >> > RAM, etc.) which is not used by any other users, so when this first
> >> > “long-time-running-query” is processing the system is basically doing
> >> > nothing
> >> > (utilization of CPU or HDD is almost 0). There is no difference client
> >> > application is connected to server from other workstation or query is
> >> > run in
> >> > SQL Management Studio directly on server.
> >> >
> >> > Do you have any ideas what is the reason of this behavior or how to
> >> > better
> >> > trace source of the problem?
> >>
> >> Do you have the auto-close option enabled for the database in question?
> >>

>

  Rponse avec citation
Vieux 19/06/2008, 13h59   #6
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Re: Strange behavior – slow performance of first query

> After this first operation every other queries (even very complicated)
> runs
> very fast (results are always returned in milliseconds).


A possible cause is that the buffer cache is cold upon the first execution
so all data must be retrieved from disk. Subsequent executions read data
from memory, which is of course much faster. This theory is consistent your
low CPU symptom but I would expect performance monitor to also report
significant disk/transfers sec. and/or disk bytes/sec.

You mention that you see this behavior even when few rows are returned.
This might indicate an inefficient queries so I suggest you examine the
execution plans for scans and other inefficiencies and perform index/query
tuning as needed. With an efficient path to the data, even queries against
cold cache out to be reasonably fast.

--
Hope this s.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Marant" <Marant@discussions.microsoft.com> wrote in message
news:640C0F94-6931-4C2A-AB5F-4F77572A0153@microsoft.com...
> My MS SQL 2005 very slowly response for every first query after few
> minutes
> of servers inactivity. It doesn’t matter if query is very simple or not,
> if
> return many rows or not, etc. Even simple SELECT on table that contains
> only
> few records takes about 15 seconds.
>
> After this first operation every other queries (even very complicated)
> runs
> very fast (results are always returned in milliseconds).
>
> SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs, 4GB
> RAM, etc.) which is not used by any other users, so when this first
> “long-time-running-query” is processing the system is basically doing
> nothing
> (utilization of CPU or HDD is almost 0). There is no difference client
> application is connected to server from other workstation or query is run
> in
> SQL Management Studio directly on server.
>
> Do you have any ideas what is the reason of this behavior or how to better
> trace source of the problem?
>


  Rponse avec citation
Vieux 20/06/2008, 15h44   #7
Random
Aucun Avatar
 
Messages: n/a
Hbergeur:
Par dfaut Re: Strange behavior – slow performance of first query

You could test the cold server theory by dumping the buffers and/or procedure
cache

dbcc dropcleanbuffers
dbcc freeproccache

Paul


"Dan Guzman" wrote:

> > After this first operation every other queries (even very complicated)
> > runs
> > very fast (results are always returned in milliseconds).

>
> A possible cause is that the buffer cache is cold upon the first execution
> so all data must be retrieved from disk. Subsequent executions read data
> from memory, which is of course much faster. This theory is consistent your
> low CPU symptom but I would expect performance monitor to also report
> significant disk/transfers sec. and/or disk bytes/sec.
>
> You mention that you see this behavior even when few rows are returned.
> This might indicate an inefficient queries so I suggest you examine the
> execution plans for scans and other inefficiencies and perform index/query
> tuning as needed. With an efficient path to the data, even queries against
> cold cache out to be reasonably fast.
>
> --
> Hope this s.
>
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
>
> "Marant" <Marant@discussions.microsoft.com> wrote in message
> news:640C0F94-6931-4C2A-AB5F-4F77572A0153@microsoft.com...
> > My MS SQL 2005 very slowly response for every first query after few
> > minutes
> > of servers inactivity. It doesn’t matter if query is very simple or not,
> > if
> > return many rows or not, etc. Even simple SELECT on table that contains
> > only
> > few records takes about 15 seconds.
> >
> > After this first operation every other queries (even very complicated)
> > runs
> > very fast (results are always returned in milliseconds).
> >
> > SQL is running on dedicated newly installed server (W2K3 Svr, 2 CPUs, 4GB
> > RAM, etc.) which is not used by any other users, so when this first
> > “long-time-running-query” is processing the system is basically doing
> > nothing
> > (utilization of CPU or HDD is almost 0). There is no difference client
> > application is connected to server from other workstation or query is run
> > in
> > SQL Management Studio directly on server.
> >
> > Do you have any ideas what is the reason of this behavior or how to better
> > trace source of the problem?
> >

>

  Rponse avec citation
Rponse


Outils de la discussion

Rgles de messages
Vous ne pouvez pas crer de nouvelles discussions
Vous ne pouvez pas envoyer des rponses
Vous ne pouvez pas envoyer des pices jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont actives : oui
Les smileys sont activs : oui
La balise [IMG] est active : oui
Le code HTML peut tre employ : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 04h08.


dit par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits rservs.
Version franaise #16 par l'association vBulletin francophone
PHWinfo est un site ducation Sans Frontires 2000-2008
Ad Management by RedTyger
©Tous droits rservs par les parties respectives
Page generated in 0,20848 seconds with 15 queries