ONDEMAND_TASK_QUEUE Wait Type in SQL Server

ONDEMAND_TASK_QUEUE is recorded by a background task while it waits for high-priority system task requests to arrive, DTC commit and abort processing being the documented example. The engine keeps this lane clear for work that cannot queue behind ordinary tasks, and the lane being empty is its normal state.

Books Online says it directly: long wait times indicate there have been no high-priority requests, and should not cause concern.

Is It a Problem?

No; it is the textbook shape of a benign wait, an always-on listener whose accumulated time measures how rarely its services were needed. It belongs on the filter list, and its totals scale with uptime.

If distributed transactions themselves misbehave, that story is told by DTC-related waits (DTC, PREEMPTIVE_DTC_*), MSDTC service health, and application errors, never by this queue’s idle time.

Common Causes

  • The instance being up, with the high-priority task listener idling.
  • Few or no distributed transactions, keeping the lane empty.

What To Do

  1. Filter it out; our Get-WaitStatistics script excludes it by default.
  2. Investigate DTC problems through MSDTC and the DTC wait family when they actually occur.
  3. Nothing else; there is no tuning surface here.

How To See It

Rank waits with Get-WaitStatistics, where it is filtered as background noise.


Part of the SQL Server Wait Types Library.
Related deep dive: SOS_SCHEDULER_YIELD Wait Type.

Comments

Leave a Reply

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