Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««1234»»»

Tempdb data file fills up very often Expand / Collapse
Author
Message
Posted Monday, August 19, 2013 1:59 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 10,381, Visits: 13,441
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

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
Post #1485989
Posted Monday, September 9, 2013 9:36 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Today @ 9:13 AM
Points: 121, Visits: 664
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.
Post #1492838
Posted Monday, September 9, 2013 10:14 AM
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, December 1, 2014 11:39 AM
Points: 611, Visits: 450
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
Post #1492857
Posted Monday, September 9, 2013 10:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, November 26, 2014 9:20 AM
Points: 25, Visits: 333
ok thank you all.
Post #1492860
Posted Wednesday, September 11, 2013 6:59 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 1:36 PM
Points: 4,473, Visits: 6,405
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 at GMail
Post #1493645
Posted Monday, September 23, 2013 4:14 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 11:53 AM
Points: 3,115, Visits: 3,241
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,
SQL Server developer at Seavus
www.seavus.com
Post #1497314
Posted Tuesday, September 24, 2013 8:55 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, December 17, 2014 8:50 AM
Points: 533, Visits: 253
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.
Post #1497928
Posted Tuesday, September 24, 2013 9:21 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:16 PM
Points: 10,381, Visits: 13,441
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

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
Post #1497943
Posted Tuesday, September 24, 2013 11:37 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, December 17, 2014 8:50 AM
Points: 533, Visits: 253
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.
Post #1497992
Posted Tuesday, September 24, 2013 12:18 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 9:22 AM
Points: 40,632, Visits: 37,094
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 2008, MVP
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

Post #1498004
« Prev Topic | Next Topic »

Add to briefcase ««1234»»»

Permissions Expand / Collapse