Date post: | 11-Jan-2017 |
Category: |
Technology |
Upload: | parikshit-savjani |
View: | 1,312 times |
Download: | 2 times |
Parikshit Savjani (@talktosavjani)Senior Program ManagerData Group
SQL Server Performance Monitoring & Baselining
2
About MeSenior Program Manager (SQL Tiger Team)
8 Years@talktosavjani
http://www.sqlserverfaq.nethttps://blogs.msdn.microsoft.com/sql_server_team/https://blogs.msdn.microsoft.com/sqlreleaseservices/
@mssqltiger
Session Objectives And Takeaways
Understand What SQL Performance Baselining means and why is it required ?
Understand the tools available for establishing a baseline in SQL Server and monitoring
Learn how to use the performance baseline tools to understand and troubleshoot performance issues
See an performance baselining and monitoring solution using SQL Server and SSRS
Why Performance Baseling?
Why SQL Performance Baselining is required?
• How slow is slow?• How fast is fast?
Performance is relative
• Identifying Hardware Reqs based on current workload and resource utilization
Capacity Planning
• Identifying the current workload, resource utilization
Consolidation
• Estimate VM Size/configuration • Estimate Cost
Virtualization\Migration to Cloud (Azure)
What is Baselining?• Performance Baselining is capturing last known good state metrics
which can be used as a starting point for comparison.
• Performance Monitoring is required for Baselining.
• The goal of performance monitoring for baselining should be, to be non-invasive with minimum overhead.
• Baselining requires capturing the performance metrics across time dimension.
• Historical Analysis of Performance Metrics is useful to understand any anomaly or to predict the future behavior.
Performance Monitoring Tools
Performance Monitoring Tools• Perfmon (Performance Monitor Logs)
• DMVs (Dynamic Management Views)
• Xevents (Extended Events)
Monitoring Resource Utilization•Processor(*)% Processor Time•Process(sqlservr)% Processor Time•Processor(*)% Privileged Time•Process(sqlservr)% Privileged Time
PROCESSOR
•Available Mbytes•Memory Pages/sec•Process(sqlservr)Private Bytes•Process(sqlservr)Working Set•SQLServer: Memory Manager Total Server Memory•SQLServer: Memory Manager Target Server Memory
Memory
•PhysicalDisk(*)Avg. Disk sec/Read•PhysicalDisk(*)Avg. Disk sec/Write•PhysicalDisk Avg. Disk Queue Length•Disk Bytes/sec•Avg Disk Bytes/Transfer •Process(sqlservr)IO Data Operations/sec
PHYSICAL DISK
•Network InterfaceBytes Received/sec •Network InterfaceBytes Sent/sec•Network Interface(*)Output Queue Length
Network IO
Monitoring SQL Server Activity• SQL Server: SQL Statistics Batch Requests/sec• SQL Server: SQL Statistics SQL Compilations/sec• SQL Server: SQL Statistics SQL Recompilations/sec• sys.dm_exec_requests• Sys.dm_exec_sessions• sys.dm_exec_connections
SQL Workload
• SQL Server: Wait Statistics• Sys.dm_os_waiting_tasks• Sys.dm_os_wait_stats
SQL Waits
• Sys.dm_db_index_physical_stats• Sys.dm_db_index_operational_stats• Sys.dm_db_index_usage_stats
Database Index fragmentation
Monitoring SQL Server system health
• Max Workers• Workers Created • Idle Workers• Deadlocks
Query Processing Health
• Latch Waits > 15 sec• Locks > 30 sec• IO Latch Timeouts• Long IO Status
Lock & Latch Waits
• Deadlocked Scheduler• Non-Yielding Scheduler• Access Violations• OOM• Corrupt Pages Status
Fatal Issues
• API Name• Error Code
Security Errors
SQL Server Tiger Team
System Health Session Monitoring• Data Collected in ring buffer target & *.xel files
in Log Folder ( 4 Rollover Files of 5MB)• Increase System Health Xel File retention
ALTER EVENT SESSION [system_health] ON SERVER STATE = STOPgoALTER EVENT SESSION [system_health] ON SERVER DROP TARGET package0.event_fileALTER EVENT SESSION [system_health] ON SERVER ADD TARGET package0.event_file
(SET filename=N'system_health.xel' ,max_file_size=(25), max_rollover_files=(5))
GOALTER EVENT SESSION [system_health] ON SERVER STATE = STARTgo
Lets Bring them all togetherSQL Performance baselining and Monitoring solution
Performance Monitoring and Baselining Solution• Should be non-invasive
• Should be scalable
• Performant
• Low Cost
ArchitectureMonitoring
Server
SQL1 SQL2 SQL3 SQLN
SQL Servers in the Environment
db2db1
dba_local
db2db1
dba_local
db2db1
dba_local
db2db1
dba_local
Central Monitoring Server
SSRS Portal
SQL Server Version, Configuration, OS information,Database Properties, Size,DataFile File Size,Storage, Backup Information SQL Server Resource Utilization, Performance Data, Wait statistics
DEMOSQL Performance baselining and Monitoring solutionhttps://github.com/amitmsft/MSSQLTIGERDemos
SQL Performance Baseline Report
Parameters:
StartDate: 08/01/2015EndDate: 08/16/2015
SQL Hourly Performance TrendParameters:SQL Server: <server-name> Date: 08/17/2015
SQL Memory Hourly Trend
User Session Status
Database Storage Report
Database Index Fragmentation Report
System Health Reports
Thank you !!
@talktosavjani@mssqltiger