SlideShare a Scribd company logo
2
Most read
15
Most read
16
Most read
MONITORING SQL SERVER
Key Performance Metrics and how to Interpret Them
Tuning blog: http://www.sqlperformance.com/
E-mail ebooks@sqlsentry.com for free copies of our $10 e-books:
YOUR PRESENTER
• John Q Martin
o Sales Engineer for SQL Sentry
o Worked with SQL Server for ~10 years
o Consultant, SQL DBA, Dev & BI Developer
o Former Microsoft Premier Field Engineer
• Contact Information
o Email: Jmartin@SQLSentry.com
o Blog: http://blogs.sqlsentry.com/author/JohnMartin/
o Twitter: @SQLDiplomat
o LinkedIn: https://uk.linkedin.com/in/johnqmartin
AGENDA
• CPU Monitoring
• Memory Monitoring
• Storage Monitoring
• SQL Server Monitoring
o Monitoring Counters
o Wait Stats
o DMVs
o Events
MONITORING APPROACHES
MONITORING FUNDAMENTALS
• Monitor over time, keep the captured data as it will be invaluable
o Don’t just grab everything “just in case”
• Use historical data to create baselines
o Baselines will allow for spotting when regular events or time periods are ‘out of band’
• Historical monitoring data can be used to perform trend analysis and capacity
planning.
CPU METRICS
• Process
o % Processor Time
o % Privileged Time
• Processor
o % Processor Time
o % Privileged Time
o % DPC Time
CPU METRICS
• Important to monitor each CPU as well as the total CPU usage.
o Helps identify potential MAXDOP issues.
o Will allow for you to see if there are possible misconfigurations in the system outside of SQL
Server
• Excessive DPC and Privileged time can indicate issues elsewhere in the
system such as networking or storage.
• Monitoring the SQL Server Processes will allow you to see how much time is
spent on SQL Server
o Depending on storage you can capture more process instances
CPU METRICS
Real Time Monitoring Tracking CPU over time.
MEMORY METRICS
• NUMA Node Memory
o Available MBytes
o Total MBytes
• Memory
o Available Mbytes
o Page Faults/sec
o Page Reads/sec
o Page Writes/sec
MEMORY MONITORING
• Understand what volumes of data are being read into and out of memory.
• Tracking memory use by NUMA node can have benefits depending on the
configuration of the system.
o Differences in the amount of memory allocated to each NUMA node can affect processing in
the CPUs within each node.
• Ensuring that there is a sufficient free memory is important to maintaining a
stable system.
MEMORY MONITORING
• Track memory by node
• Aggregate to overall
• What else is in use?
Node 1Node 0
STORAGE METRICS
• Logical Disk
o Same as Physical Disk
o Depends on your disk
configuration, if 1:1
mapping between physical
& logical then use Physical
metrics.
• Physical Disk
o Disk Read Bytes/sec
o Disk Write Bytes/sec
o Disk Reads/sec
o Disk Writes/sec
o Split IO/sec
o Current Disk Queue Length
STORAGE MONITORING
• Key monitoring elements for storage
o IOPS
o Throughput
o Latency
• Monitor amount of space used
o Sample rate does not need to be frequent, can be minutes or hours rather than seconds.
• Understand the configuration of the disks as to whether you need to use
Logical and/or Physical Disk counters.
SQL SERVER STORAGE DMVS
• sys.dm_io_virtual_file_stats()
o Gives depth to the reads & writes into each database file
o Allows you to derive Read/Write balance for data files
o IO operations and Bytes written
• sys.sm_io_pending_io_requests
o Shows outstanding file IOs for SQL Server database files.
• sys.dm_db_index_physical_stats()
o Gather index fragmentation details
o Can cause lots of IO, use sparingly on large databases
SQL SERVER METRICS
• Buffer Manager
o Buffer Cache Hit Ratio
o Checkpoint pages/sec
o Page Reads/sec
o Page Writes/sec
• Access Methods
o Forwarded Records/sec
o FreeSpace Scans/sec
o Page Splits/sec
o Workfiles Created/sec
o Worktables Created/sec
SQL SERVER METRICS
• Buffer Node
o Page Life Expectancy
o Local node Page
lookups/sec
o Remote node page
lookups/sec
• Databases
o Active Transactions
o Log Bytes Flushed/sec
o Log Flush Wait time
o Log Flush Waits/sec
o Log Flushes/sec
o Percent Log Used
PAGE LIFE EXPECTANCY
• PLE Value is meaningless, Discuss.
• Value needs to be given context
o How large is the buffer pool
o What is my IO sub-system capability
o What % of the IO Channel is used to maintain the PLE value
• Investigate changes
o What happened when PLE suddenly dropped?
• Monitor at the Buffer Node Level
o Global PLE value will not equal mean AVG of Node value.
PAGE LIFE EXPECTANCY
• Look for changes and see what
else was going on
o Large batch job/report
o Someone runs DBCC DROPCLEANBUFFERS
• Frequent monitoring required as
changes can happen fast
o Seconds to minutes for monitoring interval.
What happened ?
SQL SERVER WAITS
• ASYNC_NETWORK_IO
• LCK_*
• PAGELATCH_*
• RESOURCE_SEMAPHOR
E
• WRITELOG
• LOGBUFFER
• CXPACKET
• THREADPOOL
SQL SERVER EVENTS
• Monitor SQL Agent for Failed Jobs
• Monitor for 823, 824, 825 errors
o Can indicate storage or corruption issues
o Make use of Agent Alerts or tools to scan the agent log
• Monitor and manage the dbo.suspect_pages table in MSDB
o SQL Server will track incidences of corrupt pages here
o Limited to 1000 records so needs to be managed if there is anything here
SUMMARY
• Identify base metrics that you should be capturing and a capture frequency
o Understand why you are collecting them and how to use them effectively
• Identify specific business events and cycles and create baselines to allow for
tracking performance over multiple iterations and time
• Look for correlation between performance metrics
o Make use of CORREL function in Excel if needed
• Track changes to the environment, code, applications etc. this will help
supplement the monitoring data.
QUESTIONS
THANK YOU!
• Slides will be available at http://blogs.sqlsentry.com
• More information at:
o SQLSkills, et al
• E-mail ebooks@sqlsentry.com for free copies of our e-books:
o Just tell them where you met me
• My contact info for other questions:
o Email: Jmartin@SQLSentry.com
o Twitter: @SQLDiplomat

More Related Content

PPTX
Lubricacion, Tipos y Metodos
PDF
Troubleshooting sql server
PPTX
Lubricacion, Tipos y Metodos
PPTX
Database performance monitoring:Key to seamless application performance
PPTX
End-to-end Troubleshooting Checklist for Microsoft SQL Server
PPTX
SQL Explore 2012: P&T Part 1
PPTX
SharePoint 2013 Performance Analysis - Robi Vončina
PPTX
Visibility-from web application interface to the database
Lubricacion, Tipos y Metodos
Troubleshooting sql server
Lubricacion, Tipos y Metodos
Database performance monitoring:Key to seamless application performance
End-to-end Troubleshooting Checklist for Microsoft SQL Server
SQL Explore 2012: P&T Part 1
SharePoint 2013 Performance Analysis - Robi Vončina
Visibility-from web application interface to the database

Similar to Monitoring sql server (20)

PPTX
Monitor database essentials with Applications Manager
PPTX
Managing Memory & Locks - Series 1 Memory Management
PPTX
Sql server-performance-hafi
PDF
Collaborate 2019 - How to Understand an AWR Report
PPTX
SQL Server Wait Types Everyone Should Know
PDF
Performance tuning in sql server
PPTX
SQL 2014 In-Memory OLTP
PPTX
Silk_SQLSaturdayBatonRouge_kgorman_2024.pptx
PDF
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
PPTX
SQL Server 2016 New Features and Enhancements
PPTX
Building and configuring sql server; Some Recommended Practices.
PDF
Breaking data
PDF
Introduction to SharePoint for SQLserver DBAs
PPTX
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
PDF
Why & how to optimize sql server for performance from design to query
PPTX
Always On Availability Group Maintenance Operations
PPTX
Key to optimal end user experience
PDF
AppSphere 15 - Is the database affecting your critical business transactions?
PPTX
Investigate SQL Server Memory Like Sherlock Holmes
PPTX
Capacity Planning
Monitor database essentials with Applications Manager
Managing Memory & Locks - Series 1 Memory Management
Sql server-performance-hafi
Collaborate 2019 - How to Understand an AWR Report
SQL Server Wait Types Everyone Should Know
Performance tuning in sql server
SQL 2014 In-Memory OLTP
Silk_SQLSaturdayBatonRouge_kgorman_2024.pptx
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
SQL Server 2016 New Features and Enhancements
Building and configuring sql server; Some Recommended Practices.
Breaking data
Introduction to SharePoint for SQLserver DBAs
SharePoint Saturday St. Louis 2014: What SharePoint Admins need to know about...
Why & how to optimize sql server for performance from design to query
Always On Availability Group Maintenance Operations
Key to optimal end user experience
AppSphere 15 - Is the database affecting your critical business transactions?
Investigate SQL Server Memory Like Sherlock Holmes
Capacity Planning
Ad

More from John Martin (6)

PPTX
Tips for managing a VLDB
PPTX
Always On, Multi-Site Design Considerations
PPTX
Securing your Data, Reporting Recommended Practices
PPTX
Microsoft Azure, My First IaaS
PPTX
SQL Server 2016 AlwaysOn Availability Groups New Features
PPTX
Upgrading & Migrating SQL Sever - Southampton SQL Server user group 05/02/2014
Tips for managing a VLDB
Always On, Multi-Site Design Considerations
Securing your Data, Reporting Recommended Practices
Microsoft Azure, My First IaaS
SQL Server 2016 AlwaysOn Availability Groups New Features
Upgrading & Migrating SQL Sever - Southampton SQL Server user group 05/02/2014
Ad

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Electronic commerce courselecture one. Pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Machine learning based COVID-19 study performance prediction
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Big Data Technologies - Introduction.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
MIND Revenue Release Quarter 2 2025 Press Release
sap open course for s4hana steps from ECC to s4
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Electronic commerce courselecture one. Pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Machine learning based COVID-19 study performance prediction
A comparative analysis of optical character recognition models for extracting...
Encapsulation_ Review paper, used for researhc scholars
Diabetes mellitus diagnosis method based random forest with bat algorithm
The AUB Centre for AI in Media Proposal.docx
Review of recent advances in non-invasive hemoglobin estimation
Big Data Technologies - Introduction.pptx
Chapter 3 Spatial Domain Image Processing.pdf

Monitoring sql server

  • 1. MONITORING SQL SERVER Key Performance Metrics and how to Interpret Them
  • 3. YOUR PRESENTER • John Q Martin o Sales Engineer for SQL Sentry o Worked with SQL Server for ~10 years o Consultant, SQL DBA, Dev & BI Developer o Former Microsoft Premier Field Engineer • Contact Information o Email: [email protected] o Blog: http://blogs.sqlsentry.com/author/JohnMartin/ o Twitter: @SQLDiplomat o LinkedIn: https://uk.linkedin.com/in/johnqmartin
  • 4. AGENDA • CPU Monitoring • Memory Monitoring • Storage Monitoring • SQL Server Monitoring o Monitoring Counters o Wait Stats o DMVs o Events
  • 6. MONITORING FUNDAMENTALS • Monitor over time, keep the captured data as it will be invaluable o Don’t just grab everything “just in case” • Use historical data to create baselines o Baselines will allow for spotting when regular events or time periods are ‘out of band’ • Historical monitoring data can be used to perform trend analysis and capacity planning.
  • 7. CPU METRICS • Process o % Processor Time o % Privileged Time • Processor o % Processor Time o % Privileged Time o % DPC Time
  • 8. CPU METRICS • Important to monitor each CPU as well as the total CPU usage. o Helps identify potential MAXDOP issues. o Will allow for you to see if there are possible misconfigurations in the system outside of SQL Server • Excessive DPC and Privileged time can indicate issues elsewhere in the system such as networking or storage. • Monitoring the SQL Server Processes will allow you to see how much time is spent on SQL Server o Depending on storage you can capture more process instances
  • 9. CPU METRICS Real Time Monitoring Tracking CPU over time.
  • 10. MEMORY METRICS • NUMA Node Memory o Available MBytes o Total MBytes • Memory o Available Mbytes o Page Faults/sec o Page Reads/sec o Page Writes/sec
  • 11. MEMORY MONITORING • Understand what volumes of data are being read into and out of memory. • Tracking memory use by NUMA node can have benefits depending on the configuration of the system. o Differences in the amount of memory allocated to each NUMA node can affect processing in the CPUs within each node. • Ensuring that there is a sufficient free memory is important to maintaining a stable system.
  • 12. MEMORY MONITORING • Track memory by node • Aggregate to overall • What else is in use? Node 1Node 0
  • 13. STORAGE METRICS • Logical Disk o Same as Physical Disk o Depends on your disk configuration, if 1:1 mapping between physical & logical then use Physical metrics. • Physical Disk o Disk Read Bytes/sec o Disk Write Bytes/sec o Disk Reads/sec o Disk Writes/sec o Split IO/sec o Current Disk Queue Length
  • 14. STORAGE MONITORING • Key monitoring elements for storage o IOPS o Throughput o Latency • Monitor amount of space used o Sample rate does not need to be frequent, can be minutes or hours rather than seconds. • Understand the configuration of the disks as to whether you need to use Logical and/or Physical Disk counters.
  • 15. SQL SERVER STORAGE DMVS • sys.dm_io_virtual_file_stats() o Gives depth to the reads & writes into each database file o Allows you to derive Read/Write balance for data files o IO operations and Bytes written • sys.sm_io_pending_io_requests o Shows outstanding file IOs for SQL Server database files. • sys.dm_db_index_physical_stats() o Gather index fragmentation details o Can cause lots of IO, use sparingly on large databases
  • 16. SQL SERVER METRICS • Buffer Manager o Buffer Cache Hit Ratio o Checkpoint pages/sec o Page Reads/sec o Page Writes/sec • Access Methods o Forwarded Records/sec o FreeSpace Scans/sec o Page Splits/sec o Workfiles Created/sec o Worktables Created/sec
  • 17. SQL SERVER METRICS • Buffer Node o Page Life Expectancy o Local node Page lookups/sec o Remote node page lookups/sec • Databases o Active Transactions o Log Bytes Flushed/sec o Log Flush Wait time o Log Flush Waits/sec o Log Flushes/sec o Percent Log Used
  • 18. PAGE LIFE EXPECTANCY • PLE Value is meaningless, Discuss. • Value needs to be given context o How large is the buffer pool o What is my IO sub-system capability o What % of the IO Channel is used to maintain the PLE value • Investigate changes o What happened when PLE suddenly dropped? • Monitor at the Buffer Node Level o Global PLE value will not equal mean AVG of Node value.
  • 19. PAGE LIFE EXPECTANCY • Look for changes and see what else was going on o Large batch job/report o Someone runs DBCC DROPCLEANBUFFERS • Frequent monitoring required as changes can happen fast o Seconds to minutes for monitoring interval. What happened ?
  • 20. SQL SERVER WAITS • ASYNC_NETWORK_IO • LCK_* • PAGELATCH_* • RESOURCE_SEMAPHOR E • WRITELOG • LOGBUFFER • CXPACKET • THREADPOOL
  • 21. SQL SERVER EVENTS • Monitor SQL Agent for Failed Jobs • Monitor for 823, 824, 825 errors o Can indicate storage or corruption issues o Make use of Agent Alerts or tools to scan the agent log • Monitor and manage the dbo.suspect_pages table in MSDB o SQL Server will track incidences of corrupt pages here o Limited to 1000 records so needs to be managed if there is anything here
  • 22. SUMMARY • Identify base metrics that you should be capturing and a capture frequency o Understand why you are collecting them and how to use them effectively • Identify specific business events and cycles and create baselines to allow for tracking performance over multiple iterations and time • Look for correlation between performance metrics o Make use of CORREL function in Excel if needed • Track changes to the environment, code, applications etc. this will help supplement the monitoring data.
  • 24. THANK YOU! • Slides will be available at http://blogs.sqlsentry.com • More information at: o SQLSkills, et al • E-mail [email protected] for free copies of our e-books: o Just tell them where you met me • My contact info for other questions: o Email: [email protected] o Twitter: @SQLDiplomat