Share via

tempdb sizing

Sam 1,476 Reputation points
2023-10-18T05:31:50.5433333+00:00

Hi All,

How to size the tempdb drives? Currently,tempdata drive is 2TB and but now a days its getting filled up very quickly leaving 6mb free.

This happens when certain application queries runs. Eventually, we had to kill those queries. They are reading 76 TB worth data based on joins and so some ORDER BY clauses which are sorting the results. My question is, assuming even after tuning queries, how do we size the tempdb if we are building a new sql server VM or existing SQL server. What things to be monitored and what things to be trended and what is calculation goes on in sizing? How much we need to keep the buffer? Also, if the database is growing unevenly, lets say, every 3-6 months, then how to do the sizing?

Looking for some insights on what goes through sizing a database?

Thanks,

Sam

SQL Server | Other
SQL Server | Other

Additional SQL Server features and topics not covered by specific categories


Answer accepted by question author

Erland Sommarskog 134.7K Reputation points MVP Volunteer Moderator
2023-10-18T22:00:09.97+00:00

If the database is in the 80 TB range, I can't say that 2 TB tempdb sounds excessive.

But as Olaf said, it all depends on your workload. But given the queries we have seen from your site, 2 PB seems closer to the mark than 2 TB. :-)

A little more seriously, it's about balances. Really bad queries should be fixed. But it's not good if you have constraints like "we can only have 2 TB of tempdb" when there are legit needs for more, and developers has to go through hoops.

Was this answer helpful?


1 additional answer

Sort by: Most helpful
  1. Olaf Helper 47,621 Reputation points
    2023-10-18T05:46:03.25+00:00

    The required size for the TempDB heavily depends on your workload, and somehow on database / query design, which can cause heavy sort opertions in TempDB, isolation level and so on.

    See tempdb database and Recommendations to reduce allocation contention in SQL Server tempdb database

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.