SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Tempdb data file fills up very often


Tempdb data file fills up very often

Author
Message
Jack Corbett
  Jack Corbett
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45275 Visits: 14925
p.swathi4 (8/19/2013)
Can you suggest me the best autogrowth settings on the tempdb files


That depends on your workload, but really autogrowth should only be there for emergencies not as part of the plan. You should size tempdb (really all your databases) to what you need for your load. In your case it looks like at max load you need at least 30GB, so that should be the initial size of the database and, if that is all the space available, it shouldn't have autogrow on. If you have more space then, based on the information you've provided, I'd start with 1GB growth. But first I'd put some monitoring in place to track usage and an agent alert that fires when I reached a set % used (probably 80% in your case) so I could check what it using the space.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Talib123
Talib123
UDP Broadcaster
UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)UDP Broadcaster (1.5K reputation)

Group: General Forum Members
Points: 1457 Visits: 2365
Can you see if something is leaving allocated pages in tempdb.

select * from sys.dm_db_task_space_usage
where internal_objects_alloc_page_count <> 0

Anything which has an high alloc and low dealloc. Then whatever that spid is doing is the problem.
RatanDeep Saha
RatanDeep Saha
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1194 Visits: 693
Something below will help to find relveant information .

SELECT SUM (internal_object_reserved_page_count) AS internal_pages ,
( SUM (internal_object_reserved_page_count) * 1.0 / 128 ) AS internal_page_MB ,
SUM(internal_object_reserved_page_count ) AS user_page ,
SUM(user_object_reserved_page_count ) AS user_pages ,
SUM(user_object_reserved_page_count ) * 1.0 / 128 AS user_page_MB
FROM sys .dm_db_file_space_usage



SELECT session_id ,
SUM(internal_objects_alloc_page_count ) AS task_pages ,
SUM(internal_objects_alloc_page_count ) AS deloc_pages
FROM sys .dm_db_task_space_usage
GROUP BY session_id
psred
psred
SSC-Addicted
SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)SSC-Addicted (497 reputation)

Group: General Forum Members
Points: 497 Visits: 594
ok thank you all.
TheSQLGuru
TheSQLGuru
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32717 Visits: 8677
p.swathi4 (8/19/2013)
Can you suggest me the best autogrowth settings on the tempdb files


In this particular case I would have NO autogrowth. Make your tempdb file(s) consume the ENTIRE 30GB on SQL Server startup. Now you get ZERO fragmentation and all 30GB of space is immediately available to any and all queries without any growth. Consider having Instant File Initialization enabled to speed the file creations at startup.

I may have missed it, but where is your tempdb log file at? That could have an effect on the above statement if it too is on the same drive (which is suboptimal but may not be avoidable in smaller environments).

Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
Igor Micev
Igor Micev
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10432 Visits: 5157
Hi,

What is the recovery model of your TempDB? Default is SIMPLE, and it should be. Autogrowth of 10% is not the best option.

Citing Erland:
Do you have any databases that uses any form of snapshot isolation? You can see how much space the version store takes up in this DMV: sys.dm_db_file_space_usage.
you should have control over these stuff...

TempDB databases have to have more files on busy systems. And as yours rises quickly then you'd better add more (maybe will have to extend the storage for tempdb). There are many recommendations for them, and some are:
- Starting with number of files = 1/4 of CPU cores and then monitor the tempdb and see the need for addition of more. Consider the trace flag 1118 (What is Paul's recommendation for using trace flag 1118? Everyone should turn it on, on all instances of SQL Server, from SQL Server 2000 onwards. There's no down-side to having it turned on - http://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/)
- Once I applied this nice article: https://www.simple-talk.com/sql/database-administration/optimizing-tempdb-configuration-with-sql-server-2012-extended-events/ and I got very good results.

You should invest quite a lot time on your tempdb, it's important.

Regards
IgorMi

Igor Micev,
My blog: www.igormicev.com
AlexMcCo
AlexMcCo
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1529 Visits: 429
Microsoft recommend unlimited growth for temp databases.
Initial size should be 50 MB for all temp dbs with 500MB file growth with unlimited Max Growth. hope it helps

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Brevity is the soul of wit.
Jack Corbett
  Jack Corbett
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45275 Visits: 14925
Angeltica (9/24/2013)
Microsoft recommend unlimited growth for temp databases.
Initial size should be 50 MB for all temp dbs with 500MB file growth with unlimited Max Growth. hope it helps


This is totally incorrect. You can't make a blanket recommendation for tempDB size, this is something that needs to be considered carefully based on the workload of the individual server. A 50MB tempDB will grow almost immediately on most servers I'm involved with and I don't manage large databases. The same applies for growth, you have to determine what it should be for your environment, ideally you will create tempDB with the max size it needs so it NEVER has to grow. Autogrow should be just for emergencies or before you really know what the max size you need is. In the OP's case, tempDB is growing and filling the drive, and it may not even need that much space, so setting the initial size properly will likely solve this problem.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming
At best you can say that one job may be more secure than another, but total job security is an illusion. -- Rod at work

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
AlexMcCo
AlexMcCo
SSCommitted
SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)SSCommitted (1.5K reputation)

Group: General Forum Members
Points: 1529 Visits: 429
This is something what is being configured by Microsoft script best practice configuration. Depending on environment (hardware) we do create n number of temp databases. Also, we do 15 min tran log backup, and full database backup. Through our maintenance and best practice config we never had any issues with huge databases log files. Well, presume it is matter of experience. If I get a spec for the box, I could suggest some config options.

~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
Brevity is the soul of wit.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)SSC Guru (228K reputation)

Group: General Forum Members
Points: 228015 Visits: 46339
Angeltica (9/24/2013)
This is something what is being configured by Microsoft script best practice configuration.


To be honest, I wouldn't trust some of MS's recommendations. You cannot make a blanket statement as to how big TempDB should be. I've had servers where TempDB was over 200GB. In fact, I can't recall a server that I've worked on in the last 5 years that got a 50MB TempDB, even my desktop has it set at a couple hundred MB. The size of TempDB is defined by the workload on the server, not some statement in some old best practices guide.

Also, we do 15 min tran log backup, and full database backup.


TempDB can't be backed up, and backup frequency of user databases won't have any effect on TempDB size

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search