Core component of SQL Server for storing, processing, and securing data
Check whether this is blocking or deadlocking before you touch MAXDOP. A freeze usually means blocking.
- Diagnose
Deadlock graphs: pull them from system_health (xml_deadlock_report).
If they show exchangeEvent, the deadlocks come from parallelism, so tune the parallelism settings.
If they show keylock or pagelock, the problem is access order and indexing, so MAXDOP won’t help.
Blocking: find the head blocker with sys.dm_exec_requests. A sleeping session with an open transaction means the app isn’t committing, and that’s a fix in the application, not the database.
- Parallelism (only if you see exchangeEvent)
Raise cost threshold for parallelism from 5 to about 50.
Set MAXDOP per Microsoft’s guidance:
Single NUMA node: 8 or fewer logical processors, use at most that count; more than 8, use 8.
Multiple NUMA nodes: 16 or fewer logical processors per node, use at most that count; more than 16, use half the per-node count, capped at 16.
Prefer narrow scope: database-scoped MAXDOP, a Resource Governor group, or OPTION (MAXDOP 1) on the hot queries.
- Concurrency
Enable RCSI. It removes reader/writer blocking, but not writer/writer.
Access tables in a consistent order.
Keep transactions short.