PREEMPTIVE_OS Crypto Wait Types in SQL Server

Part of the SQL Server Wait Types Library, every wait type explained.Related deep dive: SOS_SCHEDULER_YIELD Wait TypeRelated pillar: Performance & Troubleshooting

The cryptography-related preemptive waits track Windows crypto API calls, and this page covers the family:

PREEMPTIVE_OS_BCRYPTIMPORTKEY, CRYPTACQUIRECONTEXT, CRYPTIMPORTKEY, CRYPTOPS, NCRYPTIMPORTKEY, VERIFYSIGNATURE, and VERIFYTRUST.

Their customers are the engine’s encryption features: TDE key operations, backup encryption setting up its keys, Always Encrypted and column encryption key handling, EKM/HSM providers (where the import-key calls can genuinely leave the machine), and signature verification (VERIFYTRUST, VERIFYSIGNATURE) when SQL Server validates signed DLLs and CLR assemblies, including at startup.

Are They a Problem?

Rarely; key operations are infrequent and fast against local providers. Two situations give the family real duration. First, EKM and HSM integration: when keys live on external hardware or a network service (including Azure Key Vault through EKM), the import and context calls inherit that round-trip, and a slow HSM shows up here. Second, signature verification with revocation checking: VERIFYTRUST can stall on servers without internet access while Windows tries to check certificate revocation, a classic cause of slow service starts and slow assembly loads on isolated machines.

What To Do

  1. Map accumulation to the crypto activity: TDE operations, encrypted backup windows, EKM usage, service or CLR startup.
  2. For HSM/EKM latency, measure the provider from the host; the fix is in that infrastructure.
  3. For revocation stalls on offline servers, apply Microsoft’s guidance on disabling the relevant network retrieval, a Windows setting, deliberately made.

How To See It

Rank waits with Get-WaitStatistics; occurrences pair with encryption features and verification events rather than steady workload.


Where To Go Next

PREEMPTIVE_OS Crypto is background noise on a healthy instance. If you are chasing a real problem, start with the waits that actually cost you time.

Related waits: PREEMPTIVE_OS_LOGONUSER · PREEMPTIVE_OS_WRITEFILEGATHER · PREEMPTIVE_OS Group Lookup

Comments

Leave a Reply

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