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


Capturing Baselines on SQL Server: Wait Statistics


Capturing Baselines on SQL Server: Wait Statistics

Author
Message
Erin Stellato
Erin Stellato
Mr or Mrs. 500
Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)

Group: General Forum Members
Points: 530 Visits: 418
Comments posted to this topic are about the item Capturing Baselines on SQL Server: Wait Statistics
_Beetlejuice
_Beetlejuice
Old Hand
Old Hand (358 reputation)Old Hand (358 reputation)Old Hand (358 reputation)Old Hand (358 reputation)Old Hand (358 reputation)Old Hand (358 reputation)Old Hand (358 reputation)Old Hand (358 reputation)

Group: General Forum Members
Points: 358 Visits: 1301
Hi Erin
Nice article. I have a question relating to clearing the wait statistics on an instance. On my production Servers, I capture the wait statistics every hour, as soon as I have inserted the previous hours wait statistics into the table I then clear the wait statistics. I believe that this gives me a good indication on an hourly basis of the waits on a server. Question I have though is - will I get more benefit (in terms of more accurate data for a baseline) by capturing only once a day (after backups, maintenance etc) or is it ok to leave things as they are now and capture and clear every hour.

Chris
Erin Stellato
Erin Stellato
Mr or Mrs. 500
Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)Mr or Mrs. 500 (530 reputation)

Group: General Forum Members
Points: 530 Visits: 418
_Beetlejuice (2/4/2013)
Hi Erin
Nice article. I have a question relating to clearing the wait statistics on an instance. On my production Servers, I capture the wait statistics every hour, as soon as I have inserted the previous hours wait statistics into the table I then clear the wait statistics. I believe that this gives me a good indication on an hourly basis of the waits on a server. Question I have though is - will I get more benefit (in terms of more accurate data for a baseline) by capturing only once a day (after backups, maintenance etc) or is it ok to leave things as they are now and capture and clear every hour.

Chris


Hi Chris-

Thanks for reading and for your comment! I don't think you need to change your strategy to get more of a benefit. I'd be interested in knowing whether anyone else employs a similar method of capture - specifically clearing them every hour. Have you been able to use those hour snapshots to correlate the waits back to a problem? And, do you find that when a problem does occur on the server, the hour snapshots point you in the right direction?

Thanks!

Erin
mtassin
mtassin
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9904 Visits: 72521
There is an option 4 on wait states (at least)

1. Capture the wait stats every 15 minutes
2. Store the current captured value into a staging table
3. Calculate the differences in Wait Stats between the current capture and the previous one
4. Store the differences
5. Never clear wait stats at all. Instead add a job that runs at instance start up that clears the staging table and replaces the values in it with all zeros.


Put those into a nice Tabular model in SQL 2012 or a Powerpivot in SQL 2008R2 and you can analyze with 15 minute rollups to half hours and hours. It's interesting to see your wait states across a given day.



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
mtassin
mtassin
SSCrazy Eights
SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)SSCrazy Eights (9.9K reputation)

Group: General Forum Members
Points: 9904 Visits: 72521
Erin Stellato (2/4/2013)

Hi Chris-

Thanks for reading and for your comment! I don't think you need to change your strategy to get more of a benefit. I'd be interested in knowing whether anyone else employs a similar method of capture - specifically clearing them every hour. Have you been able to use those hour snapshots to correlate the waits back to a problem? And, do you find that when a problem does occur on the server, the hour snapshots point you in the right direction?



I've managed to put my 15 minute windows to use troubleshooting a weird CMEMTHREAD wait that crops up every day at 3:30am. Haven't come up with a solution once I tracked it down by creating a trace to run between 3:15am and 3:45am and realized it as an SSIS job that was shredding tens of thousands of xml log files though. But at least I know what it is.

I've tried tweaking that particular SSIS package seven ways to sunday, but I've come to the sad conclusion that SSIS and xml just equals CMEMTHREAD waits.



--Mark Tassin
MCITP - SQL Server DBA
Proud member of the Anti-RBAR alliance.
For help with Performance click this link
For tips on how to post your problems
tim_harkin
tim_harkin
SSC Eights!
SSC Eights! (905 reputation)SSC Eights! (905 reputation)SSC Eights! (905 reputation)SSC Eights! (905 reputation)SSC Eights! (905 reputation)SSC Eights! (905 reputation)SSC Eights! (905 reputation)SSC Eights! (905 reputation)

Group: General Forum Members
Points: 905 Visits: 934
Excellent series Erin - thanks for contributing.
mark_kimsey
mark_kimsey
Valued Member
Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)Valued Member (58 reputation)

Group: General Forum Members
Points: 58 Visits: 267
Found "Waits and Queues" article by Tom Davidson here:

http://technet.microsoft.com/library/Cc966413
Kalegley
Kalegley
SSC-Enthusiastic
SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)SSC-Enthusiastic (172 reputation)

Group: General Forum Members
Points: 172 Visits: 15
Excellent work.....
webrunner
webrunner
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11805 Visits: 4056
Thanks for this article!

- webrunner

-------------------
"I love spending twice as long and working twice as hard to get half as much done!" – Nobody ever.
Ref.: http://www.adminarsenal.com/admin-arsenal-blog/powershell-how-to-write-your-first-powershell-script

"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
webrunner
webrunner
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11805 Visits: 4056
mtassin (2/4/2013)
There is an option 4 on wait states (at least)

1. Capture the wait stats every 15 minutes
2. Store the current captured value into a staging table
3. Calculate the differences in Wait Stats between the current capture and the previous one
4. Store the differences
5. Never clear wait stats at all. Instead add a job that runs at instance start up that clears the staging table and replaces the values in it with all zeros.


Put those into a nice Tabular model in SQL 2012 or a Powerpivot in SQL 2008R2 and you can analyze with 15 minute rollups to half hours and hours. It's interesting to see your wait states across a given day.


Hello Mark,

Thanks for your suggestion of an option 4. I have a related question.

I just found and ran some code to store my SQL Server's wait stats to a table. It logged 653 rows. Adding 653 rows every 15 minutes comes out, by my rough estimate, to 2,207,520 rows per year.

Is that expected as far as you're concerned? I'd like to keep as much data as needed to be useful, but I am not sure all of those rows would be. And I want to know more before I start collecting the wait stats at that rate.

Thanks for any help.

- webrunner

-------------------
"I love spending twice as long and working twice as hard to get half as much done!" – Nobody ever.
Ref.: http://www.adminarsenal.com/admin-arsenal-blog/powershell-how-to-write-your-first-powershell-script

"Operator! Give me the number for 911!" - Homer Simpson

"A SQL query walks into a bar and sees two tables. He walks up to them and says 'Can I join you?'"
Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html
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