SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


CPU usage overhead after setting Max DOP


CPU usage overhead after setting Max DOP

Author
Message
salimdallal
salimdallal
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 274
HI All,
I recently have configured the MAX DOP on our production server from 0 to 8. The machine has 16 core in total.
This was done to prevent a hanging query from consuming all the CPU of the Machine (100% CPU until the query is killed).
However, I have noticed that the overall average CPU consumption has almost doubled.
Could that be because of a MAX DOP change?
Your expert opinions are welcome Smile
Lowell
Lowell
SSC Guru
SSC Guru (182K reputation)SSC Guru (182K reputation)SSC Guru (182K reputation)SSC Guru (182K reputation)SSC Guru (182K reputation)SSC Guru (182K reputation)SSC Guru (182K reputation)SSC Guru (182K reputation)

Group: General Forum Members
Points: 182511 Visits: 41569
I think you should have fixed the one query that was the issue, since you already identified it as a problem.
instead you changed the entire server behavior to account for one bad query.

In my shop, we already have a maxdop set to 8 instead of the default of zero, because I'm under the impression that the combining of those more-than-8-parallel streams can often cost more to merge them together than a lower number of streams, so in general, i think 8 is a sweet spot.

what is double CPU for you? from 25 to 50 percent, or from 2 percent 4 percent?
i think details are going to be important here

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
salimdallal
salimdallal
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 274
Hi Lowell,
You are right about fixing the query. We are already in works with the third party vendor over this. He has to come up with the fix for it.
But in the mean time, I had to find a way so the issue would not kill the server CPU.
8 for max DOP is the sweet spot. it is also the recommended by Microsoft.
As for the details: I am talking about achange in average from the low 30s to high 50s.

Salim
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221237 Visits: 33552
In addition to MAXDOP, it's a good idea to set the Cost Threshold for Parallelism to a higher value than the default of 5. Out of the box. You'll see fewer plans going parallel unnecessarily if you make that adjustment.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
salimdallal
salimdallal
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 274
Grant Fritchey - Wednesday, August 30, 2017 8:54 AM
In addition to MAXDOP, it's a good idea to set the Cost Threshold for Parallelism to a higher value than the default of 5. Out of the box. You'll see fewer plans going parallel unnecessarily if you make that adjustment.

I don't have much experience there but i'll give do some research on this value. But from your experience have setting Max DOP caused an increase in average CPU consumption of SQL machine?

Ed Wagner
Ed Wagner
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156537 Visits: 11650
Grant Fritchey - Wednesday, August 30, 2017 8:54 AM
In addition to MAXDOP, it's a good idea to set the Cost Threshold for Parallelism to a higher value than the default of 5. Out of the box. You'll see fewer plans going parallel unnecessarily if you make that adjustment.

+1 to Grant's suggestion. I've heard this same thing for years now and I have set CTFP to 50. It did nothing but good things because almost everything didn't go parallel.



Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Ed Wagner
Ed Wagner
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156537 Visits: 11650
salimdallal - Wednesday, August 30, 2017 1:47 PM
Grant Fritchey - Wednesday, August 30, 2017 8:54 AM
In addition to MAXDOP, it's a good idea to set the Cost Threshold for Parallelism to a higher value than the default of 5. Out of the box. You'll see fewer plans going parallel unnecessarily if you make that adjustment.

I don't have much experience there but i'll give do some research on this value. But from your experience have setting Max DOP caused an increase in average CPU consumption of SQL machine?

For your research, here's a page where Paul posted how to query the plan cache. https://www.sqlskills.com/blogs/jonathan/tuning-cost-threshold-for-parallelism-from-the-plan-cache/



Tally Tables - Performance Personified
String Splitting with True Performance
Best practices on how to ask questions
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221237 Visits: 33552
salimdallal - Wednesday, August 30, 2017 1:47 PM

I don't have much experience there but i'll give do some research on this value. But from your experience have setting Max DOP caused an increase in average CPU consumption of SQL machine?


Directly? No, not really. However, changing the value will result in the optimizer making different choices since that value is taken into account. I haven't seen a radical set of changes from changing this value, but I can envision how it might happen. Do you have before & after execution plans?

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Arsh
Arsh
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2190 Visits: 822
Grant Fritchey - Wednesday, August 30, 2017 8:54 AM
In addition to MAXDOP, it's a good idea to set the Cost Threshold for Parallelism to a higher value than the default of 5. Out of the box. You'll see fewer plans going parallel unnecessarily if you make that adjustment.

Grant , is it suggested to change MAXDOP (with ref to Microsoft doc as well , based on the NUMA config) and CT for parallelism as a unanimous opinion , or there are any other areas to be considered for dependencies ? Thank you.

Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)SSC Guru (221K reputation)

Group: General Forum Members
Points: 221237 Visits: 33552
Arsh - Thursday, August 31, 2017 7:48 AM
Grant Fritchey - Wednesday, August 30, 2017 8:54 AM
In addition to MAXDOP, it's a good idea to set the Cost Threshold for Parallelism to a higher value than the default of 5. Out of the box. You'll see fewer plans going parallel unnecessarily if you make that adjustment.

Grant , is it suggested to change MAXDOP (with ref to Microsoft doc as well , based on the NUMA config) and CT for parallelism as a unanimous opinion , or there are any other areas to be considered for dependencies ? Thank you.


Nothing is ever unanimous. Of course there are differences of opinion on all this.

The general consensus is that you should change these values from the defaults. Exactly what to change them to is open to debate. I defer to others on how to deal with MAXDOP since it gets so much into hardware architecture where I just don't have adequate knowledge. I follow the guidelines offered by the SQLSkills team on this.

The Cost Threshold for Parallelism value on the other hand, I can make specific suggestions on. I have a document on the best way to identify a specific value for your system The general consensus is that you should change these values from the defaults. Exactly what to change them to is open to debate. I defer to others on how to deal with MAXDOP since it gets so much into hardware architecture where I just don't have adequate knowledge. I follow the guidelines offered by the SQLSkills team on this. The Cost Threshold for Parallelism value on the other hand, I can make specific suggestions on. I have a document on the best way to identify a specific value for your system on my blog. If you don't want to do all that work, then I can suggest starting values of 50 for OLTP and 30 for DW. If you don't want to do all that work, then I can suggest starting values of 50 for OLTP and 30 for DW.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search