Plan for the peak.
Keep TempDB balanced.
Equal data files, explicit capacity and a script you can review before applying.
Capacity profile
01 / INPUTSFile & capacity plan
02 / RESULTSTarget data files
Review script
This script returns proposed commands without executing them. Review the output, storage and service permissions, then run the selected commands separately.
Size from demand.
Grow consistently.
CPU count informs the starting file count. Measured peak usage informs capacity. RAM alone cannot predict TempDB demand.
Read your current configuration
SELECT name, type_desc, physical_name,
size / 128.0 AS size_mb,
CASE WHEN is_percent_growth = 0
THEN growth / 128.0 END AS growth_mb,
is_percent_growth
FROM tempdb.sys.database_files;Capture data and log peaks across representative workload, index maintenance and version-store activity. Current allocated size is not peak used space.File-count guidance
Start with one data file per logical processor up to eight files. If allocation contention persists, Microsoft suggests increasing by four and testing again. This planner retains higher existing counts and does not assume fewer files will improve performance.
Capacity and growth assumptions
Multiply measured data and log peaks by your headroom factor. Round each equal data file and the log target upward to 64 MB. Data growth defaults to 256 MB per file as a tool assumption; log growth defaults to 64 MB. Adjust to storage latency and observed growth. For 2017–2022, all TempDB data files can grow together: budget for the aggregate growth increment.
Review before applying
The review script discovers existing logical names, avoids requesting smaller file sizes and keeps paths for existing files. If any data file is already larger than the target, it uses the largest existing size for all data files. It does not shrink, remove or move files. Proposed new filenames must not already exist on disk.
Verify free space for preallocation and future growth on each volume. Data and log may use different volumes. Review autogrowth latency and instant file initialization; SQL Server 2022 log growth up to 64 MB can benefit from instant file initialization. Preallocation avoids relying on repeated growth events.
Scope: Windows SQL Server 2017–2022. Not an Azure SQL or failover storage planner. Guidance checked October 5, 2026.