PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.setup > Update does not utilize all processors
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ms.sqlserver.setup Questions about SQL Server.

Update does not utilize all processors

Réponse
 
LinkBack Outils de la discussion
Vieux 13/09/2006, 12h47   #1
Tom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Update does not utilize all processors

I'm running SQL2005 SP1 on win 2003 SP1.
I've noticed that when I'm running large updates, SQL is not using all
processors. When I run an update statement like:

UPDATE TestTable SET Price = Price + 1

all the processing is done on 1 processor. The box has 2 hypherthreaded
processors, so OS and SQL see 4 processors. Total CPU time is on 25% and
that means that only 1 thread is used. Testtable has over 10 million records
so it takes more than 30 minutes to update entire table that way.
Maximum degree of parallelism is set to 0, if I run a large select on a
table it uses all processors and CPU time is on 100%. Log file is also on
separate drive and there is no queue on it.
Can I force UPDATE statement to use all processors and speed up update that
way?


Tom.


  Réponse avec citation
Vieux 13/09/2006, 13h20   #2
Roy Harvey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update does not utilize all processors

You also need to consider the possibility that the process is actually
I/O bound, not CPU bound. The update you describe really doesn't have
a lot of complex processing, it mostly has to move a lot of data from
the disk and back again.

Have you tried running two such tests at the same time? Against
different tables, of course, but tables in the same database. If the
elapsed time is constant and the CPU activity doubles then the disk
activity has doubled, and a parallel plan might use some of that
reserve disk throughput. But to the degree that the elapsed time
increases it would tend to reflect an I/O bottleneck that can not be
addressed by parellel processing.

Roy Harvey
Beacon Falls, CT

On Wed, 13 Sep 2006 13:47:46 +0200, "Tom" <mcseman@hotmail.com> wrote:

>I'm running SQL2005 SP1 on win 2003 SP1.
>I've noticed that when I'm running large updates, SQL is not using all
>processors. When I run an update statement like:
>
>UPDATE TestTable SET Price = Price + 1
>
>all the processing is done on 1 processor. The box has 2 hypherthreaded
>processors, so OS and SQL see 4 processors. Total CPU time is on 25% and
>that means that only 1 thread is used. Testtable has over 10 million records
>so it takes more than 30 minutes to update entire table that way.
>Maximum degree of parallelism is set to 0, if I run a large select on a
>table it uses all processors and CPU time is on 100%. Log file is also on
>separate drive and there is no queue on it.
>Can I force UPDATE statement to use all processors and speed up update that
>way?
>
>
>Tom.
>

  Réponse avec citation
Vieux 13/09/2006, 15h47   #3
Tom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update does not utilize all processors

I tried running two tests at the same time and elapsed time stayed the same.
CPU time jumped to 50% and disk activity also doubled, specialy on the disk
where log file is located due to heavy logging (disk queue still remains on
0 most of the time).Data disk has almost no activity except when checkpoints
are acouring since both test tables fit in RAM.
So, IO subsystem is not a botleneck here and there is still a lot of CPU
power left, SQL is just not using all CPU's for such a large UPDATE and I
don't know why!!!

Tom



"Roy Harvey" <roy_harvey@snet.net> wrote in message
news:rctfg2l6q65fqtbt1j4k526cjvk820e5gu@4ax.com...
> You also need to consider the possibility that the process is actually
> I/O bound, not CPU bound. The update you describe really doesn't have
> a lot of complex processing, it mostly has to move a lot of data from
> the disk and back again.
>
> Have you tried running two such tests at the same time? Against
> different tables, of course, but tables in the same database. If the
> elapsed time is constant and the CPU activity doubles then the disk
> activity has doubled, and a parallel plan might use some of that
> reserve disk throughput. But to the degree that the elapsed time
> increases it would tend to reflect an I/O bottleneck that can not be
> addressed by parellel processing.
>
> Roy Harvey
> Beacon Falls, CT
>
> On Wed, 13 Sep 2006 13:47:46 +0200, "Tom" <mcseman@hotmail.com> wrote:
>
>>I'm running SQL2005 SP1 on win 2003 SP1.
>>I've noticed that when I'm running large updates, SQL is not using all
>>processors. When I run an update statement like:
>>
>>UPDATE TestTable SET Price = Price + 1
>>
>>all the processing is done on 1 processor. The box has 2 hypherthreaded
>>processors, so OS and SQL see 4 processors. Total CPU time is on 25% and
>>that means that only 1 thread is used. Testtable has over 10 million
>>records
>>so it takes more than 30 minutes to update entire table that way.
>>Maximum degree of parallelism is set to 0, if I run a large select on a
>>table it uses all processors and CPU time is on 100%. Log file is also on
>>separate drive and there is no queue on it.
>>Can I force UPDATE statement to use all processors and speed up update
>>that
>>way?
>>
>>
>>Tom.
>>



  Réponse avec citation
Vieux 13/09/2006, 16h03   #4
Roy Harvey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update does not utilize all processors

It is easy enough to limit parallelization, but I don't know of any
way to force it. Perhaps one of the real gurus will know some tricks
that I do not.

Roy

On Wed, 13 Sep 2006 16:47:02 +0200, "Tom" <mcseman@hotmail.com> wrote:

>I tried running two tests at the same time and elapsed time stayed the same.
>CPU time jumped to 50% and disk activity also doubled, specialy on the disk
>where log file is located due to heavy logging (disk queue still remains on
>0 most of the time).Data disk has almost no activity except when checkpoints
>are acouring since both test tables fit in RAM.
>So, IO subsystem is not a botleneck here and there is still a lot of CPU
>power left, SQL is just not using all CPU's for such a large UPDATE and I
>don't know why!!!
>
>Tom

  Réponse avec citation
Vieux 13/09/2006, 18h42   #5
Tom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update does not utilize all processors

I also tryed MAXDOP option and it works nice with SELECT but UPDATE ignores
it.

Tom


"Roy Harvey" <roy_harvey@snet.net> wrote in message
news:rctfg2l6q65fqtbt1j4k526cjvk820e5gu@4ax.com...
> You also need to consider the possibility that the process is actually
> I/O bound, not CPU bound. The update you describe really doesn't have
> a lot of complex processing, it mostly has to move a lot of data from
> the disk and back again.
>
> Have you tried running two such tests at the same time? Against
> different tables, of course, but tables in the same database. If the
> elapsed time is constant and the CPU activity doubles then the disk
> activity has doubled, and a parallel plan might use some of that
> reserve disk throughput. But to the degree that the elapsed time
> increases it would tend to reflect an I/O bottleneck that can not be
> addressed by parellel processing.
>
> Roy Harvey
> Beacon Falls, CT
>
> On Wed, 13 Sep 2006 13:47:46 +0200, "Tom" <mcseman@hotmail.com> wrote:
>
>>I'm running SQL2005 SP1 on win 2003 SP1.
>>I've noticed that when I'm running large updates, SQL is not using all
>>processors. When I run an update statement like:
>>
>>UPDATE TestTable SET Price = Price + 1
>>
>>all the processing is done on 1 processor. The box has 2 hypherthreaded
>>processors, so OS and SQL see 4 processors. Total CPU time is on 25% and
>>that means that only 1 thread is used. Testtable has over 10 million
>>records
>>so it takes more than 30 minutes to update entire table that way.
>>Maximum degree of parallelism is set to 0, if I run a large select on a
>>table it uses all processors and CPU time is on 100%. Log file is also on
>>separate drive and there is no queue on it.
>>Can I force UPDATE statement to use all processors and speed up update
>>that
>>way?
>>
>>
>>Tom.
>>



  Réponse avec citation
Vieux 14/09/2006, 03h20   #6
Andrew J. Kelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Update does not utilize all processors

Is there an index on the column you are updating? Updates are always single
threaded. That is the act of updating the row. You can't have two threads
update one row. The WHERE clause can use parallelism. In this case you are
updating the entire table so there is nothing to search per say. If there is
an index on the column you have to update that as well and it may be easier
to do that single threaded. One thing to try is specify a tablock on the
update and remove any indexes on that column.

--
Andrew J. Kelly SQL MVP

"Tom" <mcseman@hotmail.com> wrote in message
news:%23j247py1GHA.4908@TK2MSFTNGP02.phx.gbl...
> I'm running SQL2005 SP1 on win 2003 SP1.
> I've noticed that when I'm running large updates, SQL is not using all
> processors. When I run an update statement like:
>
> UPDATE TestTable SET Price = Price + 1
>
> all the processing is done on 1 processor. The box has 2 hypherthreaded
> processors, so OS and SQL see 4 processors. Total CPU time is on 25% and
> that means that only 1 thread is used. Testtable has over 10 million
> records so it takes more than 30 minutes to update entire table that way.
> Maximum degree of parallelism is set to 0, if I run a large select on a
> table it uses all processors and CPU time is on 100%. Log file is also on
> separate drive and there is no queue on it.
> Can I force UPDATE statement to use all processors and speed up update
> that way?
>
>
> Tom.
>
>



  Réponse avec citation
Vieux 08/10/2006, 12h43   #7
TRACEY
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut RE: Update does not utilize all processors

How do you know that the update is only using one processor.
I like to look into this on our system too.
Thanks
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h46.


É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 réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,14913 seconds with 15 queries