dataiotech Labs
dbaguidedbaguideDBAdataxtoolsdataopsphere
Home/Glossary/Tempdb Contention
Tempdb ContentionArchitecture & Connectivity

Tempdb Contention (PFS/GAM/SGAM Latch Çekişmesi)

Allocation page latch contention on Tempdb allocation bitmaps (PFS, GAM, SGAM) caused by heavy concurrent temp table creations and drops.

Internal Architecture Breakdown

Tempdb is a shared system resource serving temporary objects, sort spills, and the row version store. Intense concurrent allocation and deallocation of temporary tables triggers severe PAGELATCH_UP contention on shared GAM, SGAM, and PFS allocation bitmap pages.

Best practices require configuring equal-sized tempdb data files matched to physical CPU cores (up to 8 files) and enabling Memory-Optimized TempDB Metadata in SQL Server 2019+.

Production Inspection Queries

SQL Server
SELECT session_id, wait_type, wait_duration_ms, resource_description FROM sys.dm_os_waiting_tasks WHERE wait_type LIKE 'PAGELATCH_%' AND resource_description LIKE '2:%'; -- Database ID 2 = Tempdb