Questions tagged [maxdop]

Max Degree of Parallelism (MAXDOP) is a configuration option that determines the maximum number of threads dispatched by SQL Server to service queries that might benefit from parallel operation.

When SQL Server runs on a computer with more than one microprocessor or CPU, it detects the best degree of parallelism, that is, the number of processors employed to run a single statement, for each parallel plan execution. You can use the max degree of parallelism option to limit the number of processors to use in parallel plan execution. To enable the server to determine the maximum degree of parallelism, set this option to 0, the default value. Setting maximum degree of parallelism to 0 allows SQL Server to use all the available processors up to 64 processors. To suppress parallel plan generation, set max degree of parallelism to 1. Set the value to a number greater than 1 to restrict the maximum number of processors used by a single query execution. The maximum value for the degree of parallelism setting is controlled by the edition of SQL Server, CPU type, and operating system. If a value greater than the number of available processors is specified, the actual number of available processors is used. If the computer has only one processor, the max degree of parallelism value is ignored.

53 questions
75
votes
8 answers

MAXDOP setting algorithm for SQL Server

When setting up a new SQL Server, I use the following code to determine a good starting point for the MAXDOP setting: /* This will recommend a MAXDOP setting appropriate for your machine's NUMA memory configuration. You will need to evaluate…
Hannah Vernon
  • 70,928
  • 22
  • 177
  • 323
16
votes
2 answers

Why is SQL Server setup recommending MAXDOP 8 here?

I'm running SQL Server 2022 RC1 setup on an AWS i3.16xlarge with 2 sockets, 2 NUMA nodes, 32 logical processors per node, 64 logical processors altogether. Setup is recommending MAXDOP 8: But if you click on that link for configuring MAXDOP, the…
Brent Ozar
  • 43,325
  • 51
  • 233
  • 390
11
votes
2 answers

MAXDOP = 1, Query Hints and Cost Threshold For Parallelism

If an instance has MAXDOP set at 1 and query hints are used to allow specific queries to go parallel, is the Cost Threshold For Parallelism value still used by SQL to decide whether or not to actually go parallel? I haven’t been able to dig up this…
8
votes
4 answers

MAXDOP Settings for SQL Server 2014

I know this question has been asked number of times and also has answers to it but, I still need a bit more guidance on this subject. Below is the details of my CPU from SSMS: Below is CPU tab from task manager of the DB Server: I have kept the…
Learning_DBAdmin
  • 3,924
  • 19
  • 39
7
votes
1 answer

MAXDOP not working?

I wanted to test out MAXDOP on my computer. So I set MAXDOP to 2 for a specific query. However, when I looked at my logical processors in Task Manager as I ran the query, it looked like they were all being used. I thought that it would only be using…
user3469285
  • 671
  • 2
  • 10
  • 19
6
votes
1 answer

What happens to queries that are in progress when we change maxdop in live system and while they are executing?

We have a prod system that sometimes gets stuck and nothing we do helps but changing maxdop parameter on live system, after we change that all gets back normal. And it does not even matter if we change maxdop to 0 from 4, or to 2 from 1 , as long as…
Milan
  • 61
  • 2
5
votes
2 answers

SQL Server R2 Standard Edition MAXDOP setting

I'm looking for confirmation/guidance on setting MAXDOP in a SQL Server instance with the following config: Version : SQL Server 2008 R2 Standard Edition Processor : 2 x AMD Opteron(TM) Processor 6234 = 24 cores Hyperthreading enabled For…
user31265
  • 51
  • 2
5
votes
1 answer

Queries running parallel with default maxdop

I need to understand below behavior of sql server queries System has 4 CPUs with hyper thread ratio of 20 making 80 logical processors count on my sql server instance. Currently MAXDOP is 0 and ctop is 5 This is a read only instance acting as stand…
5
votes
1 answer

Cost Threshold for Parallelism with Maxdop = 1

Been debating with my company's app vendor regarding parallelism. They have maintained that Maxdop = 1 has significant performance improvements for the app/db but they have provided absolutely no proof of this. I have tested various DOP/CT settings…
Peter
  • 1,500
  • 1
  • 16
  • 36
5
votes
3 answers

How to reduce huge CXPACKET & LATCH_EX (ACCESS_METHODS_DATASET_PARENT) wait times?

Problem We have been experiencing high levels of user disruption due to SQL timeouts accross our systems since the beginning of the year. The SQL-Server instance in question has very high CPU usage (higher than 90% on all 16 cores all the time)…
matskm
  • 53
  • 1
  • 1
  • 3
4
votes
2 answers

How to determine MAXDOP setting when using DTU in Azure SQL

I have previous experience of setting MAXDOP settings for on premise OLTP & OLAP servers when you know the number of cores at your disposal. e.g. if I knew I had 16 at my disposal I'd set my MAXDOP to 2 or 4 for my OLTP system. I just joined a…
4
votes
1 answer

NUMA Nodes - MAXDOP - PLE

We have a server with 8 CPUS across 2 NUMAs with hyperthreading enabled. Currently Maxdop is set to 8, but actually should be set to 4 as per the Maxdop section of this article: https://support.microsoft.com/en-us/kb/322385 So we need to change it…
hpk89
  • 344
  • 3
  • 9
3
votes
1 answer

Maxdop in Profiler

Say I run a server side trace against a SQL Server 2008 R2 instance, which has Maxdop = 1 in place, then I run the trace through readtrace.exe to get RML files for replay. Does the replay preserve the instance-level setting of Maxdop =1 such that…
Peter
  • 1,500
  • 1
  • 16
  • 36
3
votes
1 answer

How can INDEX rebuilds be going parallel when MAXDOP is set to 1

I am periodically running into a THREADPOOL wait issue with a SharePoint data store of hundreds of databases using a SQL Server 2008R2 Standard Edition instance (recently migrated to an Azure VM). It is running a stored procedure named…
Mark Freeman
  • 2,293
  • 5
  • 32
  • 54
3
votes
2 answers

How many threads being used while query execution?

I have AdventureWorks2014 database installed on my test SQL Server 2014. I am planning to execute the following query: SELECT * FROM Sales.SalesOrderDetail sod INNER JOIN Production.Product p ON sod.ProductID = p.ProductID ORDER BY Style Before…
Rauf Asadov
  • 1,313
  • 14
  • 36
1
2 3 4