Home All Groups Group Topic Archive Search About
Author
23 Jun 2006 6:07 PM
Lianne Kwock
Hello all,

I ran a trace on a store procedure and the result showed that the duration
is 500 ms vs 80 ms on cpu.  I want to know why duration is taking a lot
longer than the cpu time.  Does anyone know what might have slowed down the
process in this case?

Any input on this is highly appreciated.


Thanks,
Lianne

Author
23 Jun 2006 6:18 PM
Gert-Jan Strik
Aparently, the CPU(s) were only the critical resource for 80ms of the
total duration. On a SMP system, it might even be less than this 80 ms.

The other time might have gone in:
- I/O (reading from disk)
- Network traffic (transferring the data to the client)
- Blocking (waiting for another process to release the required
resource)
or one of many more reasons...

Gert-Jan


Lianne Kwock wrote:
Show quote
>
> Hello all,
>
> I ran a trace on a store procedure and the result showed that the duration
> is 500 ms vs 80 ms on cpu.  I want to know why duration is taking a lot
> longer than the cpu time.  Does anyone know what might have slowed down the
> process in this case?
>
> Any input on this is highly appreciated.
>
> Thanks,
> Lianne
Author
23 Jun 2006 6:27 PM
Lianne Kwock
Thank very much for your quick response.  I appreciate it.

Show quote
"Gert-Jan Strik" wrote:

> Aparently, the CPU(s) were only the critical resource for 80ms of the
> total duration. On a SMP system, it might even be less than this 80 ms.
>
> The other time might have gone in:
> - I/O (reading from disk)
> - Network traffic (transferring the data to the client)
> - Blocking (waiting for another process to release the required
> resource)
> or one of many more reasons...
>
> Gert-Jan
>
>
> Lianne Kwock wrote:
> >
> > Hello all,
> >
> > I ran a trace on a store procedure and the result showed that the duration
> > is 500 ms vs 80 ms on cpu.  I want to know why duration is taking a lot
> > longer than the cpu time.  Does anyone know what might have slowed down the
> > process in this case?
> >
> > Any input on this is highly appreciated.
> >
> > Thanks,
> > Lianne
>
Author
23 Jun 2006 11:50 PM
Greg Linwood
Hi Lianne

Duration also includes all time taken by the application consuming the
rowset.

For example, if you open an ADO.NET command, using a data reader & then
issue a command which takes less than a second to execute within sql server.
CPU time in thie case will likely be under 1 second, but Duration depends on
how long the application takes to finish doing it's DR.Read() statements. If
you have complex businesss logic within your DR.Read() loop, Duration could
be substantially higher than CPU.

The other factors Gert listed are also all relevant but I often find this
issue to be a significant factor.

Regards,
Greg Linwood
SQL Server MVP

Show quote
"Lianne Kwock" <LianneKw***@discussions.microsoft.com> wrote in message
news:42DBDD96-C1DB-4622-B00A-326CB4BE4A1B@microsoft.com...
> Thank very much for your quick response.  I appreciate it.
>
> "Gert-Jan Strik" wrote:
>
>> Aparently, the CPU(s) were only the critical resource for 80ms of the
>> total duration. On a SMP system, it might even be less than this 80 ms.
>>
>> The other time might have gone in:
>> - I/O (reading from disk)
>> - Network traffic (transferring the data to the client)
>> - Blocking (waiting for another process to release the required
>> resource)
>> or one of many more reasons...
>>
>> Gert-Jan
>>
>>
>> Lianne Kwock wrote:
>> >
>> > Hello all,
>> >
>> > I ran a trace on a store procedure and the result showed that the
>> > duration
>> > is 500 ms vs 80 ms on cpu.  I want to know why duration is taking a lot
>> > longer than the cpu time.  Does anyone know what might have slowed down
>> > the
>> > process in this case?
>> >
>> > Any input on this is highly appreciated.
>> >
>> > Thanks,
>> > Lianne
>>

AddThis Social Bookmark Button