PREEMPTIVE_OS Network Wait Types in SQL Server

⏳Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: ASYNC_NETWORK_IO Wait TypeRelated pillar: Performance & Troubleshooting
⚡These waits are SQL Server calling Windows networking functions, and the one that matters is PREEMPTIVE_OS_GETADDRINFO: a DNS name lookup. Slow DNS makes every outbound connection by name stall, from linked servers to Availability Group endpoints. Run the check to read the average time per lookup.

Four preemptive waits track Windows networking calls, and this page covers them together:

  • PREEMPTIVE_OS_GETADDRINFO: the Windows GetAddrInfo function, which resolves a host name. Anything SQL Server connects to by name, such as a linked server or a replica, pays the lookup here.
  • PREEMPTIVE_OS_WINSOCKOPS: the generic wait for Windows sockets functions.
  • PREEMPTIVE_OS_DISCONNECTNAMEDPIPE: from the name, tearing down a named pipe connection.
  • PREEMPTIVE_OS_MESSAGEQUEUEOPS: from the name, message queue operations.

Microsoft lists them as internal use only, so the names are the guide: each is the Windows function, or group of functions, SQL Server was calling. While a call runs, the thread is in preemptive mode, outside SQL Server’s scheduler, and it shows as RUNNING.


Is It a Problem?

At small levels, no; they are not known contention points, and Get Wait Statistics does not filter them out. The one with real impact is GETADDRINFO: slow or unreliable DNS makes every outbound name lookup stall, which shows up as slow linked server connections and pauses of several seconds that disappear when DNS is fixed.

Judge it over an interval rather than the cumulative totals. The baseline to monitor is the average time per GETADDRINFO call; a rising average is a DNS finding you can hand to the infrastructure team as it stands.


Common Causes

  • Slow, overloaded or unreachable DNS servers in the server’s network configuration.
  • Linked servers or other connections configured by a name that resolves slowly or not at all.
  • A first DNS server in the list that no longer answers, so every lookup waits for a timeout first.

The Check To Run

Rank them against everything else with Get Wait Statistics, then read the averages:

SELECT
    wait_type,
    waiting_tasks_count,
    wait_time_ms,
    CAST(wait_time_ms * 1.0 / NULLIF(waiting_tasks_count, 0) AS DECIMAL(12, 2)) AS avg_wait_ms,
    max_wait_time_ms
FROM sys.dm_os_wait_stats
WHERE wait_type IN (
    N'PREEMPTIVE_OS_GETADDRINFO',
    N'PREEMPTIVE_OS_WINSOCKOPS',
    N'PREEMPTIVE_OS_DISCONNECTNAMEDPIPE',
    N'PREEMPTIVE_OS_MESSAGEQUEUEOPS')
ORDER BY wait_time_ms DESC;

Take two readings an interval apart. Then test the actual names involved from the server itself, with Resolve-DnsName or nslookup; slow lookups reproduce outside SQL Server. Get Linked Servers lists the names SQL Server connects to. The query needs VIEW SERVER STATE.


What To Do

  1. Fix DNS: the server’s DNS server list, and the records for the names it looks up.
  2. Use a hosts file entry or an IP address only as a short-term workaround while DNS is fixed.
  3. Disable protocols nothing uses, such as named pipes, as general tidiness.

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. This page.
  • PREEMPTIVE_OS_PIPEOPSPipes. Windows pipe functions, such as xp_cmdshell reading its command output.Worth a look when it climbs
  • 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

If the network preemptive waits are climbing, these are the next places to look.

Comments

Leave a Reply

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