Is It a Problem?
The wait itself is not; it lasts as long as the external command does. It was zero on our SQL Server 2025 lab. Get Wait Statistics does not filter it out, so if it ranks, you will see it. The questions it raises are operational: large amounts mean real work is done through xp_cmdshell, holding a SQL Server worker for the duration.
What It Means
Microsoft lists it as internal use only. It is the generic wait for Windows pipe functions, like using xp_cmdshell, which runs a command and reads its output through a pipe. While the call runs, the thread is in preemptive mode, outside SQL Server’s scheduler.
When It Does Matter
When a procedure is slow because the command it shells out to is slow, or a command hangs. Catch the caller:
SELECT
r.session_id,
r.wait_type,
r.wait_time AS wait_ms,
s.login_name,
s.program_name,
t.text AS running_sql
FROM sys.dm_exec_requests AS r
JOIN sys.dm_exec_sessions AS s ON s.session_id = r.session_id
OUTER APPLY sys.dm_exec_sql_text(r.sql_handle) AS t
WHERE r.wait_type LIKE N'PREEMPTIVE_OS_%'
ORDER BY r.wait_time DESC;
Then ask whether the shell-out should exist: SQL Agent CmdExec or PowerShell steps, or application code, do most of these jobs without holding a SQL Server worker. If it stays, give the command a timeout and keep it out of per-row loops. xp_cmdshell being enabled is also a security review item, and PREEMPTIVE_OS_LOGONUSER covers its proxy account logon. The baseline to monitor is its wait time per interval. The query needs VIEW SERVER STATE.
The PREEMPTIVE_OS Call Waits
Each of these is SQL Server calling a Windows function outside the file and security groups: networking, pipes, the registry, the event log, DLLs and the cluster. The time is spent in Windows. If one is near the top of your waits, read it next to the waits that usually matter.
- Network waitsDNS and sockets. GETADDRINFO name lookups and Winsock calls; slow DNS shows here.Worth a look when it climbs
- PREEMPTIVE_OS_PIPEOPSPipes. Windows pipe functions, such as xp_cmdshell reading its command output.Worth a look when it climbs. This page.
- PREEMPTIVE_OS_WAITFORSINGLEOBJECTClient sync. Synchronising with an external client process; often seen with ASYNC_NETWORK_IO.Worth a look when it climbs
- PREEMPTIVE_OS_QUERYREGISTRYRegistry. Windows registry functions.Worth a look when it climbs
- PREEMPTIVE_OS_REPORTEVENTEvent log. The Windows ReportEvent function, writing to the event log.Worth a look when it climbs
- PREEMPTIVE_OS_GETPROCADDRESSXP entry points. Finding an extended stored procedure’s address in its DLL.Worth a look when it climbs
- Library waitsDLL loading. Loading and unloading DLLs in the SQL Server process.Usually noise
- Cluster waitsFailover cluster. Windows failover cluster API calls.Usually noise
- Miscellaneous waitsEverything else. The remaining single-call waits, such as VSS, FILESTREAM device and service calls.Worth a look when it climbs
Where To Go Next
PREEMPTIVE_OS_PIPEOPS follows xp_cmdshell. If you are chasing a real problem, start with the waits that cost you time.
- MSQL_XP, extended stored procedures, xp_cmdshell included.
- 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