CXSYNC_PORT is parallel plan threads waiting to open, close or synchronise the exchange ports that pass rows between them. The documented example is a long sort that must finish before the port can sync. It shows parallelism, not trouble by itself. Run the check to find the parallel queries and look at their plans for the operator holding things up.Microsoft’s definition: it occurs with parallel query plans when waiting to open, close, and synchronize Exchange Iterator ports between producer and consumer threads, and gives an example: with a long sort in the plan, these waits can be higher because the sort must finish before the port can be synchronised. It exists from SQL Server 2022 and in Azure SQL Database and Managed Instance; it was split out of CXPACKET, with CXSYNC_CONSUMER, to make parallel plan problems easier to investigate.
Is It a Problem?
Treat it as part of the CX family: evidence of parallelism, not proof of trouble, and not a reason on its own to cut MAXDOP. On our SQL Server 2025 lab it was the largest CX wait, about 1,300 seconds in a day against under 5 for CXPACKET, so do not be surprised to see it lead the family on 2022 and later.
Where it adds something is plan shape. Following that example, sustained port waits point at a blocking operator, such as a sort, hash build or spool, between producers and consumers. Judge it over an interval rather than the cumulative totals: the baseline to monitor is the CX family’s share of wait time, and this wait’s rise when particular queries slow down.
Common Causes
- Parallel plans with a long sort, hash build or spool feeding an exchange.
- Large sorts and hashes over big parallel scans.
- Poor estimates stretching the blocking operator’s work.
- Cheap queries going parallel because the cost threshold is low.
The Check To Run
Rank it against everything else with Get Wait Statistics, then find the parallel queries doing the most work:
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;
Open the plans of the top rows and look for the sort, hash or spool sitting before an exchange; that operator’s input is what to tune. The query needs VIEW SERVER STATE.
What To Do
- Reduce what the blocking operator has to process: an index that provides the order, tighter predicates, or fresh statistics for accurate memory grants.
- Keep parallelism settings deliberate. A
cost threshold for parallelismraised from the default of 5 keeps cheap queries serial; MAXDOP and cost threshold has the reasoning. - Change MAXDOP only as a considered setting for the workload, not as a reaction to this wait existing.
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. This page.
- CXSYNC_CONSUMERConsumer synchronisation. Consumer threads waiting to reach an exchange synchronisation point, from SQL Server 2022.Worth a look when it climbs
- 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_PORT is sitting near the top of your wait stats, these are the next places to look.
- CXPACKET and CXCONSUMER, the main parallelism page.
- MAXDOP and Cost Threshold for Parallelism, the two settings behind most parallel plans.
- The waits that usually matter, ranked, with what each one is telling you.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply