In short
TempDB is one of the busiest system databases in SQL Server. It is used for temporary tables, sorting, joins, row versioning, spills, index operations, and many internal SQL Server tasks. On a Windows VPS, poor TempDB configuration can create avoidable performance problems. A practical starting point is to use multiple TempDB data files, fixed file sizes, fixed autogrowth, and a layout that matches the VPS CPU count and workload.
Quick verdict
| Situation | Recommended action |
|---|---|
| Fresh SQL Server install | Check current TempDB file layout |
| 2-8 vCPU Windows VPS | Start with one TempDB data file per vCPU, up to 8 files |
| Files use percent autogrowth | Change to fixed MB autogrowth |
| TempDB files are tiny | Pre-size them to avoid constant growth |
| SQL Server workload uses sorting/reporting heavily | Monitor TempDB usage and spills |
| Production server | Change TempDB during a maintenance window |
| SQL Server Express test VM | Use small lab-safe TempDB sizes |
Do not blindly create dozens of TempDB files. Start with a sensible baseline, monitor, then adjust.
Why TempDB matters
TempDB is recreated every time SQL Server starts. Even though it is temporary, it is critical for performance.
SQL Server uses TempDB for:
- Temporary tables
- Table variables
- Sorting
- Hash joins
- Index rebuilds
- Row versioning
- Snapshot isolation
- Online operations
- Query spills
- Internal worktables
- Some DBCC operations
If TempDB is poorly configured, users may experience slow queries, blocking, high disk activity, or inconsistent performance during reporting and maintenance jobs.
For small databases, the default TempDB layout may be acceptable. For production SQL Server workloads, you should at least review it.
What we tested on Raff
We tested this walkthrough on a Raff Windows VPS running Windows Server 2025 Datacenter Evaluation and SQL Server 2025 Express.

Test environment:
| Item | Value |
|---|---|
| Provider | Raff Technologies |
| OS | Windows Server 2025 Datacenter Evaluation |
| SQL Server | SQL Server 2025 Express |
| Instance | SQLEXPRESS |
| CPU | 4 vCPU |
| Test database | TempDB system database |
| Test date | 2026-05-26 |
| Tester | Serdar Tekin |
On this VM, we verified:
- SQL Server service state
- Current TempDB file layout
- SQL Server CPU and scheduler count
- TempDB file count planning
- TempDB file size and growth configuration
- SQL Server service restart
- Final TempDB layout after restart
We used small lab-safe file sizes for the test. Production file sizes should be based on workload, disk capacity, and observed TempDB usage.
Step 1 - Check current TempDB layout
Before changing anything, check the current TempDB files.
Run:
sqlcmd -S .\SQLEXPRESS -E -C -Q "SELECT name, type_desc, physical_name, size * 8 / 1024 AS size_mb, growth * 8 / 1024 AS growth_mb, is_percent_growth FROM tempdb.sys.database_files;"
Review:
| Column | Meaning |
|---|---|
name | Logical file name |
type_desc | ROWS for data file, LOG for log file |
physical_name | File path on disk |
size_mb | Current file size |
growth_mb | Autogrowth size |
is_percent_growth | Whether growth uses percent instead of fixed size |
For production, avoid percent-based growth. Fixed MB growth is more predictable.
Step 2 - Check CPU count for file planning
A common starting rule is:
Use one TempDB data file per logical CPU, up to 8 files, then monitor contention before adding more.
Check SQL Server CPU count:
sqlcmd -S .\SQLEXPRESS -E -C -Q "SELECT cpu_count, scheduler_count FROM sys.dm_os_sys_info;"

For our 4 vCPU test VM, a reasonable baseline is:
4 TempDB data files + 1 TempDB log file
For many SMB Windows VPS workloads, this is enough.
Recommended TempDB file count
Use this as a starting point:
| vCPU count | Starting TempDB data files |
|---|---|
| 1 vCPU | 1 file |
| 2 vCPU | 2 files |
| 4 vCPU | 4 files |
| 8 vCPU | 8 files |
| 16+ vCPU | Start with 8 files, then monitor |
Do not automatically create one file per CPU above 8. More files are not always better.
If you still see allocation contention after 8 files, investigate wait stats and workload behavior before adding more.
Step 3 - Choose file size and autogrowth
TempDB should not grow constantly during normal workload.
A good production strategy is:
- Estimate typical TempDB usage.
- Pre-size files so normal workload does not trigger growth.
- Use fixed MB autogrowth.
- Keep all TempDB data files the same size.
- Keep all TempDB data files with the same growth setting.
For the lab, we used small values:
| File type | Lab size | Lab growth |
|---|---|---|
| TempDB data files | 64 MB each | 64 MB |
| TempDB log file | 64 MB | 64 MB |
For production, common starting values may be larger:
| Workload | Starting data file size |
|---|---|
| Small app / dev | 256 MB - 1 GB each |
| SMB production app | 1-4 GB each |
| Reporting-heavy workload | Based on observed usage |
| Large SQL workload | Size from monitoring and testing |
Do not copy lab sizes into production without checking workload needs.



This confirms the new TempDB file layout is active.