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


CXPacket and PAGEIOLATCH_EX or SH


CXPacket and PAGEIOLATCH_EX or SH

Author
Message
cbarus
cbarus
Old Hand
Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)

Group: General Forum Members
Points: 365 Visits: 160
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.



Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)

Group: General Forum Members
Points: 100165 Visits: 33014
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 Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
cbarus
cbarus
Old Hand
Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)

Group: General Forum Members
Points: 365 Visits: 160
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.



Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)SSC Guru (100K reputation)

Group: General Forum Members
Points: 100165 Visits: 33014
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 Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Evil Kraig F
Evil Kraig F
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21243 Visits: 7660
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
cbarus
cbarus
Old Hand
Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)Old Hand (365 reputation)

Group: General Forum Members
Points: 365 Visits: 160
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.



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