נועם

847 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
847
On SlideShare
0
From Embeds
0
Number of Embeds
121
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

נועם

  1. 1. SQL ServerParallel Processing for Pros
  2. 2. Agenda• Parallel Processing Concepts• Single Query Optimization• Workload Optimization
  3. 3. Parallel ProcessingHow does it Work ?
  4. 4. Preemptive Scheduling Thread 1 CMD CMDCore Scheduler CMD Thread 2 CMD CMD CMD Thread 3 CMD CMD Context Switch CMD
  5. 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. 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. 7. Now you own theParallelism Matrix !
  8. 8. What about the1 Million Dollar Question ?
  9. 9. What degree of parallelism (DOP) is optimal ?
  10. 10. Parallel System Configuration• MAXDOP• Cost Threshold for Parallelism• Max Workers
  11. 11. Parallel System Configuration• MAXDOP• Cost Threshold for Parallelism• Max Workers
  12. 12. MaxDop• Default• Microsoft Recommendation• Other Recommendations: Start with Cores / 3 - Cores / 2 and check CXPACKET
  13. 13. MaxDop – What people do? http://www.sqlskills.com/BLOGS/PAUL/post/M AXDOP-configuration-survey-results.aspx
  14. 14. Waits – What people have? http://www.sqlskills.com/BLOGS/PAUL/post/W ait-statistics-or-please-tell-me-where-it- hurts.aspx
  15. 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. 16. Parallel System Configuration• MAXDOP• Cost Threshold for Parallelism• Max Workers
  17. 17. Cost Threshold for Parallelism• Default (5)• Other Recommendations: 5 is too low, Get it higher to 50 Jonathan Kehayias Recommendation
  18. 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. 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. 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. 21. Thank youTo: • Guy Glantser (Madeira) • Haim Fishner (Madeira) • Adam Machanic • R Meyyappan (http://www.sqlworkshops.com/) Contact Us: www.madeira.co.il
  22. 22. Thank You! Noam Brezis Email:noam@madeira.co.il Website:www.madeira.co.il

×