SQL SERVER – PREEMPTIVE Waits and Scheduler Context

Preemptive waits can measure work outside SQL Server cooperative scheduling. A customer asked about their increase during a health check.

A continuous thread passes through an external fixture and returns to its loom.

SQLOS normally schedules workers cooperatively. Certain external API calls require a worker to enter preemptive mode. Windows then controls that portion of execution. This is not evidence that an unrelated higher-priority process interrupted a query.

SELECT wait_type, waiting_tasks_count, wait_time_ms FROM sys.dm_os_wait_stats WHERE wait_type LIKE N'PREEMPTIVE%' ORDER BY wait_time_ms DESC;

The exact wait suffix matters. File operations, security checks and other external work have different causes. Counters can include expected activity and can reset. Compare interval deltas with affected requests, durations and system activity.

Don’t change server priority because of a cumulative PREEMPTIVE total. Identify the external operation and its contribution to delay. The linked wait series provides additional context.

Reference: Wait statistics and external waits.

Related reading

A PREEMPTIVE total is not proof of harmful interruption, it is external-operation timing to correlate with an observed delay.

Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.


Discover more from SQL Authority with Pinal Dave

Subscribe to get the latest posts sent to your email.

SQL Scripts, SQL Server, SQL Wait Stats
Previous Post
SQL SERVER – Multiple Optimize Hint for a Query
Next Post
SQL SERVER – 3 Different Ways to Set MAXDOP

Related Posts

1 Comment. Leave new

  • I found preemptive_os_cryptacquirecontext, preemptive_os_cryptops and preemptive_os_authorizationops happen at the same time. Also os_scheduler_yield has a spike as well.

    My environment is VM. How related between os_scheduler_yield and those preemptive* waits ?

    Reply

Leave a Reply

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

Fill out this field
Fill out this field
Please enter a valid email address.