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

CXPacket and PAGEIOLATCH_EX or SH Expand / Collapse
Author
Message
Posted Tuesday, February 5, 2013 1:42 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 9:54 AM
Points: 80, Visits: 140
My company processes data for our clients. We have one database for each of the clients. Largest DB is around 750 GB and the smaller ones would be around 100 GB. Main data load would be in batches and each batch would load around 3-4 million records each to 3-4 tables mainly. We are on SQL 2008, on VM with 16GB of RAM. Storage is SAN. Intel 4 core (hyperthreaded)

During the loads, I see a lot of CXPacket waits coupled with PAGEIOLATCH_EX. I looked at the VMWare counter active bytes in MB and that is most often times at around 8GB. Does this mean that SQL Server is only using half of the available memorty? If yes, does that mean that PAGEIOLATCH_EX is because the disk subsystem ?

Any ideas or direction would be greatly appreciated.



Post #1416070
Posted Tuesday, February 5, 2013 4:10 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 15,725, Visits: 28,130
CXPacket waits are an indication of parallelism. Not to say that parallelism is the issue, just that it's going on. Something you'd have to validate.

The latch waits are absolutely and indication of disk issues. If you're seeing them during loads, it sort of makes sense because that's when an exclusive lock is most likely to be taken out, but that's what you're seeing, IO.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1416148
Posted Tuesday, February 5, 2013 4:22 PM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 9:54 AM
Points: 80, Visits: 140
Thanks for your insight Grant. Yes, regarding CXPacket waits, I am looking into Parallelism. Right now, the queries (INSERTS) span as 16 threads and some of the threads are getting the CXPacket waits. I will have to see if I could rewrite the queries so that SQL Server could balance the work uniformly across these threads. Other option would be to reduce the MAXDOP to 3, 2 and 1 and also observe the performance.

I am going to talk to the server team about the latches.



Post #1416153
Posted Tuesday, February 5, 2013 4:32 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 4:14 PM
Points: 15,725, Visits: 28,130
Another option on the parallelism is to look at the cost threshold for parallelism. That's usually left at the default value of 5 which is WAY too low for most systems. You might try bumping that up to 25 or 30 as a starting point.

Since this is a virtual, we kind of can't trust the CPU measures, so be cautious about changing the maxdop settings unless you can also confirm from the VMWare monitoring that CPU is an issue.


----------------------------------------------------
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood..." Theodore Roosevelt
The Scary DBA
Author of: SQL Server 2012 Query Performance Tuning
SQL Server 2008 Query Performance Tuning Distilled
and
SQL Server Execution Plans

Product Evangelist for Red Gate Software
Post #1416159
Posted Tuesday, February 5, 2013 5:14 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 10:23 PM
Points: 6,253, Visits: 7,428
I have seen heavy maxdop interfere with writes and I/O, but it would have to be an extreme case for me to look towards that as a culprit. If you are going to adjust for maxdop, which I do on massive inserts mostly to save threads for other processes, I wouldn't go down to 1 initially except for simple testing. If you're getting 16 threads, try halving it to 8, and another run at 4. If you get nearly the exact same timing runs, leave it there as it's not helping you but will interfere with other pieces of the system.

+1 for Grant's observation about the CPU monitoring in VMWare as well. It's a skewed lens to look at the system through unless you're in the VM software itself.



- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1416173
Posted Wednesday, February 6, 2013 11:02 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, September 3, 2014 9:54 AM
Points: 80, Visits: 140
Thanks to both for your thoughts. I was planning on gradually reducing the maxdop to see if there is any performance improvement. Regarding the memory and CPU, I am depending on the counters provided by VMware and not the regular windows counters.

I will do some work on this and post my update shortly.

Thanks for your time again.



Post #1416646
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse