Is It a Problem?
Under normal conditions, no; allocations pass through quickly and the wait stays in the noise. Get Wait Statistics does not filter it out, so if it ranks, you will see it. There is one well-known exception: a bug on NUMA systems running SQL Server 2012 and 2014 that could drive it very high, fixed in later cumulative updates. On those versions, patching is the answer, not tuning.
What It Means
Microsoft describes it as the time a thread waits to acquire the mutex it must acquire before it allocates physical pages, or before it returns them to the operating system, and says it only appears when the instance uses AWE memory. On 64-bit SQL Server that means locked pages in memory: the service account holds the Lock pages in memory right. You can see which model the instance runs:
SELECT sql_memory_model_desc
FROM sys.dm_os_sys_info;
LOCK_PAGES means locked pages are in use. On our lab it read CONVENTIONAL, and the wait was zero.
When It Does Matter
If it ranks on a patched build, the instance is allocating or releasing physical memory heavily. Check whether max server memory leaves the operating system enough room, and whether the memory pressure indicators are otherwise healthy. The baseline to monitor is its wait time per interval staying close to zero; anything else on a current build is worth a support case.
The SOS Family
These are SQLOS waits, the layer that schedules threads and hands out memory inside SQL Server. Most are internal synchronisation that never needs attention. The one that usually matters is the main page, SOS_SCHEDULER_YIELD.
- SOS_SCHEDULER_YIELDCPU yield. A thread giving up the scheduler after its quantum and waiting to run again.The main page for this family
- SOS_WORK_DISPATCHERIdle threads. A SQLOS thread waiting to be given work, from SQL Server 2019.Usually noise
- SOS_DISPATCHER_MUTEXDispatcher pools. Internal synchronisation of a dispatcher pool, including when it is resized.Usually noise
- SOS_SYNC_TASK_ENQUEUE_EVENTSynchronous task start. A task started synchronously, waiting until it begins running.Usually noise
- SOS_MEMORY_TOPLEVELBLOCKALLOCATORLarge allocations. The allocator that takes large blocks of memory from the buffer pool.Usually noise
- SOS_PHYS_PAGE_CACHEPhysical pages. The mutex around allocating physical pages from, and returning them to, the operating system.Worth a look when it climbs. This page.
- SOS_WORKER_MIGRATIONWorker moves. Undocumented; associated with workers moving between schedulers.Usually noise
Where To Go Next
SOS_PHYS_PAGE_CACHE is usually small. If you are chasing a real problem, start with the waits that cost you time.
- The waits that usually matter, ranked, with what each one is telling you.
- SOS_SCHEDULER_YIELD, the SQLOS wait that usually matters, CPU pressure.
- Performance & Troubleshooting, the scripts and guides for this part of the stack.
Leave a Reply