SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 CXPacket Waits
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

ferrethouse
Constraint Violating Yak Guru

303 Posts

Posted - 06/27/2012 :  16:10:34  Show Profile  Reply with Quote
41% of the waits in my database are CXPACKET. I currently have 12 physical cores with HT so 24 total cores. I have the max degree of parallelism set to 6. Should I reduce that or is there a way to identify which specific queries are causing the CXPACKET waits and use the MAXDOP hint for them individually?

ferrethouse
Constraint Violating Yak Guru

303 Posts

Posted - 06/27/2012 :  16:43:00  Show Profile  Reply with Quote
I found some of the queries. I used the maxdop hint on those queries and they ran slower. so apparently the waits associated with the cxpacket are worth it??? maybe it isn't a problem...
Go to Top of Page

robvolk
Most Valuable Yak

USA
15559 Posts

Posted - 06/27/2012 :  17:06:35  Show Profile  Visit robvolk's Homepage  Reply with Quote
Run this:

select *, wait_time_ms/1.0/waiting_tasks_count avg_wait
from sys.dm_os_wait_stats
where wait_time_ms>0
order by avg_wait desc, wait_type

See what your average and max wait time is for CXPACKET. If it seems low enough and you're not seeing it impact performance then don't worry about it. Look at other waits with a higher average wait time and try to fix them, unless they have a low count.
Go to Top of Page

ferrethouse
Constraint Violating Yak Guru

303 Posts

Posted - 06/27/2012 :  17:13:04  Show Profile  Reply with Quote
quote:
Originally posted by robvolk

Run this:

select *, wait_time_ms/1.0/waiting_tasks_count avg_wait
from sys.dm_os_wait_stats
where wait_time_ms>0
order by avg_wait desc, wait_type

See what your average and max wait time is for CXPACKET. If it seems low enough and you're not seeing it impact performance then don't worry about it. Look at other waits with a higher average wait time and try to fix them, unless they have a low count.



Thanks Rob. The average doesn't seem bad. The max seems a bit high but I don't really know what constitutes high...

quote:

max = 171759
average = 3.91065309

Go to Top of Page

ferrethouse
Constraint Violating Yak Guru

303 Posts

Posted - 06/27/2012 :  17:17:04  Show Profile  Reply with Quote
Interestingly, the database mirroring is the worst wait in terms of total amount...

DBMIRROR_EVENTS_QUEUE
DBMIRRORING_CMD

Wonder if mirroring is worth it as opposed to a DRP that simply involves restores.
Go to Top of Page

robvolk
Most Valuable Yak

USA
15559 Posts

Posted - 06/27/2012 :  17:41:16  Show Profile  Visit robvolk's Homepage  Reply with Quote
I recommend reading Glenn Berry's blog and using his diagnostic queries:

http://sqlserverperformance.wordpress.com/2010/05/02/recap-of-april-2010-dmv-a-day-series/

He updates them regularly and describes what constitutes a normal wait vs. one that needs investigation. Mirroring waits can typically be ignored, as long as mirroring itself is not causing a significant performance hit (one that you don't need a DMV query to notice).
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

Sweden
29138 Posts

Posted - 06/28/2012 :  04:52:51  Show Profile  Visit SwePeso's Homepage  Reply with Quote
CXPACKETS happens when the different streams have to wait for eachother; ie one stream is done earlier than another and have to wait until bering ready and put together again.
Reasons for this could be old statistics, multiple filegroups on different drives for example.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

jackv
Flowing Fount of Yak Knowledge

United Kingdom
1769 Posts

Posted - 06/28/2012 :  11:40:41  Show Profile  Visit jackv's Homepage  Reply with Quote
Understanding the nature of the database server usage is imporatnt. For example an OLTP may be more effective - with less HT. A Reporting server, with typical multiple join statements may benefit from higher parallelism

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page

ferrethouse
Constraint Violating Yak Guru

303 Posts

Posted - 06/28/2012 :  15:45:29  Show Profile  Reply with Quote
We recently turned on HT at the recommendation of Brett Ozar (performed an analysis of our database). We did see overall waits decrease significantly after the change. Perhaps the CXPACKET increase is simply the price to be paid for reducing the other waits with HT???
Go to Top of Page

robvolk
Most Valuable Yak

USA
15559 Posts

Posted - 06/28/2012 :  16:00:21  Show Profile  Visit robvolk's Homepage  Reply with Quote
Yes.

Waits are a normal part of database operations. The goal is to determine which waits are truly detrimental and reduce or eliminate them. Ultimately you'll end up with a list of waits that can no longer be avoided, and hopefully don't impact your server.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000