hi experts, 2005. This 2005 db server has 6 user dbs. User dbs and tempdb are on same raid array made up of 5 physical disks. TEMPDB has 1 data file. 1. Is there a way to determine whether the tempdb database is causing slow performance or having contention? 2. Would creating multiple data files for tempdb, say 2 or 4 or 8, but keeping them on the same above array - provide any benefit? (server has 2 dual-core processors) Thanks much. John
Welcome to the forum!1) You can create a big tempdb said, 2GB to ovoid resize all the time.2) Definitely no.Now, you have to run Profiler to analyze the application. I think the performance problem is there (bad code, indexes, etc.).
Thank you, Louis. Just a quick follow-up question please. I have a Database Maintenance Plan that runs every Sunday. First, it performs reindexing on all tables. The next task reorganizes each table, with a 90 % fill-factor. Am I doing these steps in the correct order, or should the reindexing come AFTER the reorganize? Thanks, John
If I understand, you are doing the same twice.When you reindex tables (indexes, if fact), the function keep the same original fill factor. Except you change that.So, if any index was created with fill-factor 90, then when you run DBCC REINDEX, 90 is default.My suggestion is: find in this forum some script to run REINDEX only when is necessary according fragmentation.With this script you can run it not only on Sunday, also 2 working days in windows time, to keep performance.
Tempdb contention:If SPID's are in wait state and wait resource is eithere 2:1:1 or 2:1:3 then there is tempdb contention. Regarding files:Yes it does makes sense to create multiple files even on same drive but they should be of same size. http://support.microsoft.com/kb/328551 http://www.microsoft.com/technet/prodtechnol/sql/2005/tsprfprb.mspx
Capture performance monitor counters for TEMPDB and post it. Because u r using 5 spindles it is important to know if you have loacted tempdb files on seperately or shared with user databses.
Thanks everyone. The TEMPDB is on the same logical drvive (5 physical disks) as the user databases. 2 dual-core processors. So is that 4 processors, meaning I need 4 tempdb files all of same size? Thanks John
1) If you have determined that tempdb is suffering from performance. I would recommend placeing tempdb on seperate set of drives so it won't affect your user database performance. This whitepaper http://www.microsoft.com/technet/prodtechnol/sql/2005/workingwithtempdb.mspx explains Tempdb improvements in SQL Server 2005,best practices and monitoring space requirement. I hope this will help you in troubleshooting 2) Yes. You are correct. 2 Dual cores means 4 logical processors for Windows. FYI- Windows doesn't know about physical CPU sockets so even if you have 2 processors HYPERTHREADED it shows 4 procs in task manager. Dual cores are better performer than Hyperthreaded procs. 3) Yes, 4 tempdb, all equal sizes (to make them follow proportional fill algorithm in SQL Server, otherwise largest file will be used most). Thanks Saurabh
In SQL Server 2005, there are many DMV which use to monitor the Tempdb. You may check this http://madhuottapalam.blogspot.com/2007/01/sql-server-2005-dmvs-for.html Madhu