RESOURCE_SEMAPHORE_MUTEX

Description

This wait occurs when queries cannot be compiled because SQL Server is waiting for threads to become available. SQL Server caps the amount of queries that can be compiled at once. This wait is often present when the number of Availability Group or database mirrors is excessive. Small values typically do not cause an issue. If values are moderate or high then investigation is required

Resolved by

DBAs

Suggested solutions

  1. Decrease query complexity
  2. Appropriate indexing could reduce plan complexity
  3. Improve plan reuse (therefore compilation can be avoided)
  4. Increase the number of CPU cores available

Additional research

Thread Usage by Availability Groups
What is RESOURCE_SEMAPHORE_QUERY_COMPILE?

⇐ Back to index