Your SlideShare is downloading. ×
נועם
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

נועם

572
views

Published on

Published in: Technology, Travel

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
572
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. SQL ServerParallel Processing for Pros
  • 2. Agenda• Parallel Processing Concepts• Single Query Optimization• Workload Optimization
  • 3. Parallel ProcessingHow does it Work ?
  • 4. Preemptive Scheduling Thread 1 CMD CMDCore Scheduler CMD Thread 2 CMD CMD CMD Thread 3 CMD CMD Context Switch CMD
  • 5. How does it work in SQL Server Thread Pool (Workers) Tasks BatchCPU Core SELECT … Task Read… ….. Read… ….. Write… UPDATE … …. Calculate… …. Write… Pending Tasks Scheduler Max Workers !!
  • 6. CPU Scheduling Runnable Queue Suspended (Waiting) TasksCPU Core IO_COMPLETION Read… LCK_M_X Calculate… Write… Scheduler Running Task - Worker Pending Tasks Read… Write…
  • 7. Now you own theParallelism Matrix !
  • 8. What about the1 Million Dollar Question ?
  • 9. What degree of parallelism (DOP) is optimal ?
  • 10. Parallel System Configuration• MAXDOP• Cost Threshold for Parallelism• Max Workers
  • 11. Parallel System Configuration• MAXDOP• Cost Threshold for Parallelism• Max Workers
  • 12. MaxDop• Default• Microsoft Recommendation• Other Recommendations: Start with Cores / 3 - Cores / 2 and check CXPACKET
  • 13. MaxDop – What people do? http://www.sqlskills.com/BLOGS/PAUL/post/M AXDOP-configuration-survey-results.aspx
  • 14. Waits – What people have? http://www.sqlskills.com/BLOGS/PAUL/post/W ait-statistics-or-please-tell-me-where-it- hurts.aspx
  • 15. MaxDop• It’s only a hint, SQL Server might still choose a serial plan• Change of MAXDOP setting for the server, will flush the plan cache.
  • 16. Parallel System Configuration• MAXDOP• Cost Threshold for Parallelism• Max Workers
  • 17. Cost Threshold for Parallelism• Default (5)• Other Recommendations: 5 is too low, Get it higher to 50 Jonathan Kehayias Recommendation
  • 18. My RecommendationIt really depends on your workload, you needto first test:For OLTP have• Higher Cost Threshold (50)• Start with low MAXDOP (8-12)For OLAP have• Higher Cost Threshold (50)• Start with high MAXDOP (Cores / 2)
  • 19. My RecommendationsRun Jonathan Kehayias Script to tune CostThreshold for Parallelism.Run a trace, change MAXDOP, rerun a traceon the same workload and run QureAnalyzer (Free !) until you find the perfectMAXDOP.Override MAXDOP if necessary (Use PlanGuides):• In OLTP override with a higher MAXDOP.• In OLAP override with a lower MAXDOP.
  • 20. Become a true Pro !Join one of our courses:  SQL Server 2012 – Guy Glantser  Storage for DBAs – Tzahi Hakikat  Advanced Programming in SQL Server – Noam Brezis Contact Us: www.madeira.co.il
  • 21. Thank youTo: • Guy Glantser (Madeira) • Haim Fishner (Madeira) • Adam Machanic • R Meyyappan (http://www.sqlworkshops.com/) Contact Us: www.madeira.co.il
  • 22. Thank You! Noam Brezis Email:noam@madeira.co.il Website:www.madeira.co.il