CXSYNC_CONSUMER Wait Type in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: CXPACKET and CXCONSUMER Wait TypesRelated pillar: Performance & Troubleshooting

Is It a Problem?

Read it the way you read CXPACKET: it shows parallel plans are running, which is often what you want. Do not just lower the server MAXDOP to make it go away. Get Wait Statistics does not filter it out, so if it ranks, you will see it. On our SQL Server 2025 lab it had about 2,500 waits and 85 seconds in a day, alongside the other CX waits.

It is worth a look when it dominates on a workload that should not be running heavy parallel queries, or rises with complaints about specific queries.


What It Means

Microsoft’s definition: it occurs with parallel query plans when waiting to reach an Exchange Iterator synchronization point among all consumer threads, from SQL Server 2022 and in Azure SQL Database and Managed Instance. It and CXSYNC_PORT were split out of CXPACKET to make parallel plan problems easier to investigate. If new CX waits appeared after an upgrade to 2022, the accounting changed, not your workload.


When It Does Matter

When it rises, find the parallel queries doing the most work; queries whose CPU time exceeds their elapsed time ran in parallel:

SELECT TOP (20)
    qs.total_elapsed_time / 1000 AS total_elapsed_ms,
    qs.total_worker_time / 1000 AS total_cpu_ms,
    qs.execution_count,
    SUBSTRING(t.text, 1, 200) AS query_start
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS t
WHERE qs.total_worker_time > qs.total_elapsed_time
ORDER BY qs.total_worker_time DESC;

Then look at those plans. Common fixes are a cost threshold for parallelism raised from the default of 5 so cheap queries stay serial, fresh statistics, and indexes for the predicates that drive big parallel scans; MAXDOP and cost threshold covers the settings. The baseline to monitor is the CX family’s share of wait time per interval, read together. The query needs VIEW SERVER STATE.


The CX Family

These are the parallelism waits. They prove parallel plans are running, which is often what you want, and they are read together rather than one at a time. The main page is CXPACKET and CXCONSUMER.

  • CXPACKET / CXCONSUMERExchange waits. Producer and consumer threads in a parallel plan waiting on each other.The main page for this family
  • CXSYNC_PORTPort synchronisation. Opening, closing and synchronising exchange ports, from SQL Server 2022.Worth a look when it climbs
  • CXSYNC_CONSUMERConsumer synchronisation. Consumer threads waiting to reach an exchange synchronisation point, from SQL Server 2022.Worth a look when it climbs. This page.
  • CXROWSET_SYNCParallel range scan. Child threads of a parallel range scan coordinating.Usually noise
  • EXCHANGEExchange iterator. Synchronisation in the exchange iterator of a parallel query.Worth a look when it climbs

Where To Go Next

If CXSYNC_CONSUMER is climbing, these are the next places to look.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *