Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 TEMPDB

Author  Topic 

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 14:52:43
On SQL 2005 - Got the standard TEMPDEV AND TEMPLOG.

I have a process that consumes 100% CPU - Indexes are all good.
I see there are about 1689805 locks that occur on this process.

I saw the programs are PAGEIIO LATCH_EX CXPACKET.

So if im correct this is TEMPDB issue? So i was going to add more temp files for the 8 CPU.

On TEMPDB do you add another FILEGROUP or just add FILES.
templog1, templog2, so i should add 7 more...so i have 8 temp log and 1 tempdata.

Then set autogrowth to NONE and size
DATASIZE 10024 and TRANSACTION LOG 2048

Any advice would be appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-26 : 15:01:17
Use my script to add the tempdb files:
http://weblogs.sqlteam.com/tarad/archive/2008/05/20/60604.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 15:10:36
That look interesting - Do you recommend keeping the AUTO GROWTH set to automatic or NONE.

If i do on production now do i have to reboot or providing the size is lower than the 1024 which is what i was going to set it to for the cpu.

Cheers.
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 15:21:45
I ran on my laptop version of SQL 2005 i have two CPU

So it creates a TEMPDEV DATA
TEMPDEV_2 DATA
TEMPLOG LOG

So its the DATA file is per CPU so if i run on 8 CPU i end up with
TEMPDEV DATA
TEMPDEV_2 DATA
TEMPDEV_3 DATA
to
TEMPDEV_8 DATA
TEMPLOG LOG

And it is set to autogrowth --- Is that ok to leave as this kind of prefer so it not restricted by growth.


Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-26 : 15:22:22
quote:

That look interesting - Do you recommend keeping the AUTO GROWTH set to automatic or NONE.

If i do on production now do i have to reboot or providing the size is lower than the 1024 which is what i was going to set it to for the cpu.



I don't recommend setting it to none as what happens if it needs the space for some reason and you do have enough space on disk for it to grow some?

Mine are set to grow by 200MB and unrestricted growth.

My script does modify the grow by option, so if you use my script make sure to pass in the MB value to @growth.

My blog entry for that script shows what my recommedation is for when to run it. You don't need to reboot/restart, but it depends on your current data file size and what you'll be setting them all to.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-26 : 15:23:57
quote:
Originally posted by TRACEYSQL

I ran on my laptop version of SQL 2005 i have two CPU

So it creates a TEMPDEV DATA
TEMPDEV_2 DATA
TEMPLOG LOG

So its the DATA file is per CPU so if i run on 8 CPU i end up with
TEMPDEV DATA
TEMPDEV_2 DATA
TEMPDEV_3 DATA
to
TEMPDEV_8 DATA
TEMPLOG LOG

And it is set to autogrowth --- Is that ok to leave as this kind of prefer so it not restricted by growth.




Yes it's the data files to add. It's all explained in the MS link in my blog entry.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 15:30:30
Cheers thanks for the help....I do some more reading then run it in production.
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 15:32:34
What kind of scripts report do you run after the effect to ensure that problem is not tempdb related....I kind of did it the other way around by seeing PAGE_IO and LATCH_EX ....

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-26 : 15:38:09
To be honest, I don't know. The MS link in my blog entry says to add data files when tempdb is found to be a performance problem, but it doesn't say how to determine that. We've just made it a standard practice to add tempdb data files according to how many CPUs we have since it won't hurt you to have this config but it may hurt you if you don't.

We had MS come out to help us with our performance problems a few years back. One of the fixes was this tempdb thing, which is why we've made it a standard practice for all of our prod systems on not just ones having issues.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 15:42:49
No problem...Last thing ran on dev box and the tempdev remained at 8 MB and the tempdev2 tempdev3 set to 1024.

But first tempdev is 8 ...i cannot go into this and set to 1024 so they are all equal.

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-26 : 15:48:16
Try doing it manually via the GUI to see if you get an error.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 15:53:18
Says specified file size is less than current.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-26 : 16:19:08
You'll need to restart the service in order to fix that file. I believe I covered this scenario in my blog entry.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

TRACEYSQL
Aged Yak Warrior

594 Posts

Posted - 2008-06-26 : 16:20:59
Cheers will do thanks.
I just ran my large application and still at 636,460 locks seconds pusshes the CPU to 100% so back to the drawing board on analysis
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-06-28 : 00:39:50
Adding more files in tempdb will not solve your issue if those locks are held in user db.
Go to Top of Page
   

- Advertisement -