SlideShare una empresa de Scribd logo
1 de 15
Amit Banerjee
Senior PFE
Microsoft Corporation
SQL Server Scheduling
Basics
About Me
Amit Banerjee
• Senior Premier Field Engineer, Bangalore, India
• 7+ years with Microsoft
• Formerly with SQL Server CSS Escalation Services
• Technology expertise: Databases (SQL Server), Debugging
Highlights:
• Owner of www.TroubleshootingSQL.com
• Speaker at various SQL community events
• Co-author of Professional SQL Server 2012: Internals and
Troubleshooting
• Guest Author for SQL Server World Wide Users Group (SSWUG)
Contact Information
Blog: www.troubleshootingsql.com
Twitter: @banerjeeamit
Twitter: @TblshootingSQL
Email: troubleshootingsql@outlook.com
Facebook: www.facebook.com/TroubleshootingSQL
7/13/2013 3
WHY?
We wanted to write
more code!!
We didn’t know
Windows did
scheduling!!
7/13/2013 4
ACTUALLY
Avoid thread context
switches as much as
possible
Support async I/O
Support fibers
Avoid causing kernel
mode wherever
possible
QUEUE
7/13/2013 5
MORE
QUEUES
7/13/2013 6
AND ….
7/13/2013 7
SQL OS
7/13/2013 8
Scheduling
I/O
Completion
Memory
management
Resource
Management
Max Worker
Threads
7/13/2013 9
MIND IT!!
Max
Worker
Threads
7/13/2013 10
For a 32-bit operating system:
Total available logical CPUs <= 4
Max Worker Threads = 256
Total available logical CPUs > 4
Max Worker Threads = 256 + ((logical CPUs -
4)*8)
For a 64-bit operating system:
Total available logical CPUs <= 4
Max Worker Threads = 512
Total available logical CPUs > 4
Max Worker Threads = 512 + ((logical CPUs -
4)*16)
QUEUES
7/13/2013 11
Timer List
I/O ListWaiter List
Runnable List
Runnable
List
7/13/2013 12
Bhaag worker thread… Bhaag
DEMO
7/13/2013 13
Some workers worker
threads were hurt
during the preparation
of this demo!!
Resources
7/13/2013 14
UMS Scheduler
http://msdn.microsoft.com/en-us/library/aa175393(v=SQL.80).aspx
SQL OS DMVs
http://msdn.microsoft.com/en-us/library/ms176083.aspx
Slava’s Blog
http://blogs.msdn.com/b/slavao/archive/2005/07/20/441058.aspx
Professional SQL Server 2012: Internals and Troubleshooting
Available on Flipkart and Amazon
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or
other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must
respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided
after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION
www.troubleshootingsql.com
@banerjeeamit
troubleshootingsql@outlook.com
Facebook.com/TroubleshootingSQL

Más contenido relacionado

Destacado

February 2015 MRC Newsletter
February 2015 MRC NewsletterFebruary 2015 MRC Newsletter
February 2015 MRC Newsletter
Andrew Rosales
 
December 2 weekly jobboard
December 2 weekly jobboardDecember 2 weekly jobboard
December 2 weekly jobboard
Golden Jefferson
 
Customs and Cross-border measures
Customs and Cross-border measuresCustoms and Cross-border measures
Customs and Cross-border measures
patent_unitedipr
 
Abigail Orozco's Resume
Abigail Orozco's ResumeAbigail Orozco's Resume
Abigail Orozco's Resume
Abigail Orozco
 
Level 3 DataCentersGlobal
Level 3 DataCentersGlobalLevel 3 DataCentersGlobal
Level 3 DataCentersGlobal
Jeffrey Briggs
 

Destacado (17)

HKETA 2017 Annual Book
HKETA 2017 Annual BookHKETA 2017 Annual Book
HKETA 2017 Annual Book
 
Car
CarCar
Car
 
February 2015 MRC Newsletter
February 2015 MRC NewsletterFebruary 2015 MRC Newsletter
February 2015 MRC Newsletter
 
December 2 weekly jobboard
December 2 weekly jobboardDecember 2 weekly jobboard
December 2 weekly jobboard
 
Single Tenant Property For Sale
Single Tenant Property For SaleSingle Tenant Property For Sale
Single Tenant Property For Sale
 
Sperry Van Ness #CRE National Sales Meeting 8-18-14
Sperry Van Ness #CRE National Sales Meeting 8-18-14Sperry Van Ness #CRE National Sales Meeting 8-18-14
Sperry Van Ness #CRE National Sales Meeting 8-18-14
 
Ethnic Markets, Buffalo New York
Ethnic Markets, Buffalo New YorkEthnic Markets, Buffalo New York
Ethnic Markets, Buffalo New York
 
Customs and Cross-border measures
Customs and Cross-border measuresCustoms and Cross-border measures
Customs and Cross-border measures
 
A Curitiba De Antigamente
A Curitiba De AntigamenteA Curitiba De Antigamente
A Curitiba De Antigamente
 
Abigail Orozco's Resume
Abigail Orozco's ResumeAbigail Orozco's Resume
Abigail Orozco's Resume
 
Debaratiitactcyberterrorimchapter
DebaratiitactcyberterrorimchapterDebaratiitactcyberterrorimchapter
Debaratiitactcyberterrorimchapter
 
Bloomington-Normal 2015 Demographic Profile
Bloomington-Normal 2015 Demographic Profile Bloomington-Normal 2015 Demographic Profile
Bloomington-Normal 2015 Demographic Profile
 
NJFuture Redevelopment Forum 2016 Toth
NJFuture Redevelopment Forum 2016 TothNJFuture Redevelopment Forum 2016 Toth
NJFuture Redevelopment Forum 2016 Toth
 
Projects and Work Experience
Projects and Work ExperienceProjects and Work Experience
Projects and Work Experience
 
Level 3 DataCentersGlobal
Level 3 DataCentersGlobalLevel 3 DataCentersGlobal
Level 3 DataCentersGlobal
 
Curitiba de antigamente - atualizado
Curitiba de antigamente - atualizadoCuritiba de antigamente - atualizado
Curitiba de antigamente - atualizado
 
Introduction to SharePoint 2013 Out of the box Webparts
Introduction to SharePoint 2013 Out of the box WebpartsIntroduction to SharePoint 2013 Out of the box Webparts
Introduction to SharePoint 2013 Out of the box Webparts
 

Similar a SQL Server Scheduling Basics

Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Mark Broadbent
 

Similar a SQL Server Scheduling Basics (20)

SQL Server Tips and Tricks - Power
SQL Server Tips and Tricks - PowerSQL Server Tips and Tricks - Power
SQL Server Tips and Tricks - Power
 
Resume
ResumeResume
Resume
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
Marcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL WorkbenchMarcin Szałowicz - MySQL Workbench
Marcin Szałowicz - MySQL Workbench
 
Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51Getting Started with SQL Server Compact Edition 3.51
Getting Started with SQL Server Compact Edition 3.51
 
Getting Started with Sql Server Compact Edition
Getting Started with Sql Server Compact EditionGetting Started with Sql Server Compact Edition
Getting Started with Sql Server Compact Edition
 
Resume
ResumeResume
Resume
 
Microsoft TechEd India 2012 Backup Restore
Microsoft TechEd India 2012 Backup RestoreMicrosoft TechEd India 2012 Backup Restore
Microsoft TechEd India 2012 Backup Restore
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
Provisioning Azure Virtual Machines to run SQL Server
Provisioning Azure Virtual Machines to run SQL ServerProvisioning Azure Virtual Machines to run SQL Server
Provisioning Azure Virtual Machines to run SQL Server
 
06 integrating extra features and looking forward
06   integrating extra features and looking forward06   integrating extra features and looking forward
06 integrating extra features and looking forward
 
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons LearnedITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
ITARC15 Workshop - Architecting a Large Software Project - Lessons Learned
 
Sql interview question part 10
Sql interview question part 10Sql interview question part 10
Sql interview question part 10
 
Ebook10
Ebook10Ebook10
Ebook10
 
Passing a Front end Developer interview
Passing a Front end Developer interview Passing a Front end Developer interview
Passing a Front end Developer interview
 
Practical SharePoint 2013 Development Environment
Practical SharePoint 2013  Development EnvironmentPractical SharePoint 2013  Development Environment
Practical SharePoint 2013 Development Environment
 
Jsp Comparison
 Jsp Comparison Jsp Comparison
Jsp Comparison
 
Database Configuration for Maximum SharePoint 2010 Performance
Database Configuration for Maximum SharePoint 2010 PerformanceDatabase Configuration for Maximum SharePoint 2010 Performance
Database Configuration for Maximum SharePoint 2010 Performance
 
Perfect Performance Platter - SQL Server 2014
Perfect Performance Platter - SQL Server 2014 Perfect Performance Platter - SQL Server 2014
Perfect Performance Platter - SQL Server 2014
 
Share point 2013: introduction, features, and roles
Share point 2013: introduction, features, and rolesShare point 2013: introduction, features, and roles
Share point 2013: introduction, features, and roles
 

Más de Amit Banerjee

Más de Amit Banerjee (20)

The Roadmap for SQL Server 2019
The Roadmap for SQL Server 2019The Roadmap for SQL Server 2019
The Roadmap for SQL Server 2019
 
Azure database services for PostgreSQL and MySQL
Azure database services for PostgreSQL and MySQLAzure database services for PostgreSQL and MySQL
Azure database services for PostgreSQL and MySQL
 
Upgrade your SQL Server like a Ninja
Upgrade your SQL Server like a NinjaUpgrade your SQL Server like a Ninja
Upgrade your SQL Server like a Ninja
 
SQL PASS 2017 - Building one million predictions per second using SQL Server ...
SQL PASS 2017 - Building one million predictions per second using SQL Server ...SQL PASS 2017 - Building one million predictions per second using SQL Server ...
SQL PASS 2017 - Building one million predictions per second using SQL Server ...
 
Building 1 million predictions per second using SQL-R
Building 1 million predictions per second using SQL-RBuilding 1 million predictions per second using SQL-R
Building 1 million predictions per second using SQL-R
 
Troubleshooting common scenarios with Always On - A Dress Rehearsal
Troubleshooting common scenarios with Always On - A Dress RehearsalTroubleshooting common scenarios with Always On - A Dress Rehearsal
Troubleshooting common scenarios with Always On - A Dress Rehearsal
 
Enhancements to High Availability, Disaster Recovery and Replication
Enhancements to High Availability, Disaster Recovery and ReplicationEnhancements to High Availability, Disaster Recovery and Replication
Enhancements to High Availability, Disaster Recovery and Replication
 
Securing SQL Server with TLS 1.2
Securing SQL Server with TLS 1.2Securing SQL Server with TLS 1.2
Securing SQL Server with TLS 1.2
 
AlwaysOn Troubleshooting Improvements
AlwaysOn Troubleshooting ImprovementsAlwaysOn Troubleshooting Improvements
AlwaysOn Troubleshooting Improvements
 
Always On Availability Group Troubleshooting Ninja
Always On Availability Group Troubleshooting Ninja Always On Availability Group Troubleshooting Ninja
Always On Availability Group Troubleshooting Ninja
 
Debugging made easier with extended events
Debugging made easier with extended eventsDebugging made easier with extended events
Debugging made easier with extended events
 
You, SQL Server and PowerShell
You, SQL Server and PowerShellYou, SQL Server and PowerShell
You, SQL Server and PowerShell
 
SQL Saturday 511 - Troubleshooting made easier using extended events
SQL Saturday 511 - Troubleshooting made easier using extended eventsSQL Saturday 511 - Troubleshooting made easier using extended events
SQL Saturday 511 - Troubleshooting made easier using extended events
 
Slow query bring it on
Slow query bring it onSlow query bring it on
Slow query bring it on
 
Performance Demystified for SQL Server on Azure Virtual Machines
Performance Demystified for SQL Server on Azure Virtual MachinesPerformance Demystified for SQL Server on Azure Virtual Machines
Performance Demystified for SQL Server on Azure Virtual Machines
 
Backup enhancements with SQL Server 2014
Backup enhancements with SQL Server 2014Backup enhancements with SQL Server 2014
Backup enhancements with SQL Server 2014
 
Troubleshooting SQL Server using Power Pivot and Power View
Troubleshooting SQL Server using Power Pivot and Power ViewTroubleshooting SQL Server using Power Pivot and Power View
Troubleshooting SQL Server using Power Pivot and Power View
 
System health session
System health sessionSystem health session
System health session
 
Debugging the Deadlock for the Scheduler
Debugging the Deadlock for the SchedulerDebugging the Deadlock for the Scheduler
Debugging the Deadlock for the Scheduler
 
Managing SQL Server Made Easy - Features and Concepts
Managing SQL Server Made Easy - Features and ConceptsManaging SQL Server Made Easy - Features and Concepts
Managing SQL Server Made Easy - Features and Concepts
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 

SQL Server Scheduling Basics

  • 1. Amit Banerjee Senior PFE Microsoft Corporation SQL Server Scheduling Basics
  • 2. About Me Amit Banerjee • Senior Premier Field Engineer, Bangalore, India • 7+ years with Microsoft • Formerly with SQL Server CSS Escalation Services • Technology expertise: Databases (SQL Server), Debugging Highlights: • Owner of www.TroubleshootingSQL.com • Speaker at various SQL community events • Co-author of Professional SQL Server 2012: Internals and Troubleshooting • Guest Author for SQL Server World Wide Users Group (SSWUG) Contact Information Blog: www.troubleshootingsql.com Twitter: @banerjeeamit Twitter: @TblshootingSQL Email: troubleshootingsql@outlook.com Facebook: www.facebook.com/TroubleshootingSQL
  • 3. 7/13/2013 3 WHY? We wanted to write more code!! We didn’t know Windows did scheduling!!
  • 4. 7/13/2013 4 ACTUALLY Avoid thread context switches as much as possible Support async I/O Support fibers Avoid causing kernel mode wherever possible
  • 10. Max Worker Threads 7/13/2013 10 For a 32-bit operating system: Total available logical CPUs <= 4 Max Worker Threads = 256 Total available logical CPUs > 4 Max Worker Threads = 256 + ((logical CPUs - 4)*8) For a 64-bit operating system: Total available logical CPUs <= 4 Max Worker Threads = 512 Total available logical CPUs > 4 Max Worker Threads = 512 + ((logical CPUs - 4)*16)
  • 11. QUEUES 7/13/2013 11 Timer List I/O ListWaiter List Runnable List
  • 13. DEMO 7/13/2013 13 Some workers worker threads were hurt during the preparation of this demo!!
  • 14. Resources 7/13/2013 14 UMS Scheduler http://msdn.microsoft.com/en-us/library/aa175393(v=SQL.80).aspx SQL OS DMVs http://msdn.microsoft.com/en-us/library/ms176083.aspx Slava’s Blog http://blogs.msdn.com/b/slavao/archive/2005/07/20/441058.aspx Professional SQL Server 2012: Internals and Troubleshooting Available on Flipkart and Amazon
  • 15. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION www.troubleshootingsql.com @banerjeeamit troubleshootingsql@outlook.com Facebook.com/TroubleshootingSQL