SlideShare a Scribd company logo
1 of 19
Download to read offline
Troubleshooting SQL Server
Performance Tips & Techniques
Notes from the Field
Amit Khandelwal
Support Escalation Engineer
Agenda
Performance Troubleshooting Tools
SQLDIAGPSSDIAG
SQL Nexus
SQL Nexus Analysis
Waits analysis
CPUSpinlocks
Old School Tricks!!!
Slow IO Troubleshooting
Common Mysteries & Important Trace flags
Performance Troubleshooting Tools
SQLDIAGPSSDIAG
SQL Nexus
SQLDIAG– Data collection utility
Windows Event Logs (Application, System, and Security) in .CSV files
System Monitor (aka Perfmon) performance counters in .BLG file/s
SQL Server Profiler traces in .TRC file/s
SQL Server error logs, configuration, point-in-time snapshots of several DMVs in a .OUT
file
System information via the Msinfo32 utility
Custom scripts for collecting blocking specific data
All configuration parameters are stored in SQLDiag.xml file and can be changed
PSSDIAG – Data Collection Utility
Similar to SQLDIAG utility except for the user interface
• CPU spikes on the SQL Server box
• Performance degradation during specific hours (say
between 4:00 PM and 6:00 PM daily)
• Blocking on SQL Server
• Overall performance bottlenecks in SQL Server using
wait statistics
SQL Nexus – Data analysis tool
Helpful in post-mortem analysis of performance issues
Uses RML utilities (Readtrace) – It’s a pre-requisite
Tool Highlights:
Trace aggregation to show TOP N most expensive queries
Wait stats analysis for visualizing blocking and other resource contention issues
Visualize loaded data via Reports – uses SSRS client side report viewer
PSSDIAG and SQL Nexus:
Nexus analyses data when SQLDiag is clubbed with SQLxxxxPerfStats script
SQLxxxxPerfStats scripts captures DMVs output including blocking information
PSSDIAG & SQL Nexus
Hands-On
Slow IO troubleshooting
I/O Troubleshooting
2015-28-08 00:00:00.00 spid1 SQL Server has encountered 192 occurrence(s) of IO requests taking longer
than 15 seconds to complete on file [E:SQLServerTestdb.mdf] in database [Testdb] (7). The OS file
handle is 0x00000000000074D4. The offset of the latest long IO is: 0x00000000022000.
The message indicates that SQL Server has been waiting on at least one I/O for 15 seconds or longer
This represents StuckStalled IO requests on SQL Server
I/O Troubleshooting
Tools and Techniques
• Performance Monitor Counters (Perfmon)
PhysicalDiskAv
g. Disk
sec/Transfer
(<0.015)
PhysicalDiskAv
g. Disk Queue
Length
(<2 per spindle)
PhysicalDisk%
Idle Time
(~100%)
PhysicalDiskDisk
Bytes/sec
ProcessIO Data
Bytes/sec(sqlserver)
sys.dm_io_pending_io_requests
Look out for “io_pending” column of this DMV. The io_pending column indicates 1 if the I/O is
still pending within the kernel.
COMMON MYSTERIES
Common Mysteries
SQL Server is using high CPU, but PSSDIAG does not show CPU getting accounted to the
queries running in SQL Server!!!
How does Rebuildreorg indexes affect statistics?
SQL Server consumes all the memory that I give!!
Why do I see huge number of child spids waiting on CXPACKET even though my MAXDOP
is set to a lower value?
Important TIPS
Important Trace Flags
T4199 This trace flag is a combination of a lot of optimizer related fixes released under
different trace flags.
T1236 Enable this trace flag when you see elevated values occur for LOCK_HASH spinlock
count especially during following operations: SQL Server logins, Linked server queries,
sp_reset_connection, Transactions
T1117 This trace flag applies to the entire SQL Server instance, not just to one DB, and it
affects all files in the same file group in a database.
T1118 This trace flag forces uniform extent allocations instead of mixed page
allocations. The trace flag is commonly used to assist in TEMPDB scalability by avoiding
SGAM and other allocation contention points
T8048 This trace flag will upgrade NODE based partitioning to CPU based partitioning.
Remember this requires more memory overhead but can provide performance increases on
these highly transactional OLTP systems.
Power plan setting*
Max Degree of
Parallelism
Max Server Memory
Client Side Tracing
Missing Indexes DMV &
Database Tuning
Advisor
Upgrade SQL to latest
HotfixesSPs
References
PSSDIAG
http://diagmanager.codeplex.com/releases
http://technet.microsoft.com/en-us/library/ms162833.aspx
http://blogs.msdn.com/b/pamitt/archive/2011/02/25/how-to-use-the-sqldiag-the-sqlnexus-and-the-pal-tools-to-analyze-performance-issues-in-sql-server.aspx
SQL Nexus
http://sqlnexus.codeplex.com/
https://sqlnexus.codeplex.com/wikipage?title=GETTING_STARTED
http://sqlnexus.codeplex.com/wikipage?title=Sql2005PerfStatsScript&referringTitle=Home
https://sqlnexus.codeplex.com/wikipage?title=collecting%20data%20using%20batch%20files&referringTitle=GETTING_STARTED
http://sqlnexus.codeplex.com/wikipage?title=readtrace&referringTitle=Sql2005PerfStatsScript
Slow IO Troubleshooting
http://support.microsoft.com/kb/897284
http://blogs.msdn.com/b/karthick_pk/archive/2012/06/26/io_2d00_bottlenecks.aspx
http://blogs.msdn.com/b/cindygross/archive/2010/03/17/what-do-those-io-requests-taking-longer-than-15-seconds-messages-on-my-sql-box-mean.aspx
References
Pssdiag and sql nexus

More Related Content

What's hot

Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to query
Antonios Chatzipavlis
 
Fatkulin hotsos 2014
Fatkulin hotsos 2014Fatkulin hotsos 2014
Fatkulin hotsos 2014
Enkitec
 
Oracle performance tuning_sfsf
Oracle performance tuning_sfsfOracle performance tuning_sfsf
Oracle performance tuning_sfsf
Mao Geng
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
Kyle Hailey
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
Kernel Training
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
Simon Huang
 

What's hot (20)

Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to query
 
Columnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil AgarwalColumnstore Customer Stories 2016 by Sunil Agarwal
Columnstore Customer Stories 2016 by Sunil Agarwal
 
SQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query PerformanceSQL Server Query Optimization, Execution and Debugging Query Performance
SQL Server Query Optimization, Execution and Debugging Query Performance
 
Fatkulin hotsos 2014
Fatkulin hotsos 2014Fatkulin hotsos 2014
Fatkulin hotsos 2014
 
Performance tuning in sql server
Performance tuning in sql serverPerformance tuning in sql server
Performance tuning in sql server
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should Know
 
SQL Server Performance Tuning Baseline
SQL Server Performance Tuning BaselineSQL Server Performance Tuning Baseline
SQL Server Performance Tuning Baseline
 
Oracle performance tuning_sfsf
Oracle performance tuning_sfsfOracle performance tuning_sfsf
Oracle performance tuning_sfsf
 
Remote Database Administration Services | Shreeyansh Technologies
Remote Database Administration Services | Shreeyansh TechnologiesRemote Database Administration Services | Shreeyansh Technologies
Remote Database Administration Services | Shreeyansh Technologies
 
Database Performance Tuning
Database Performance Tuning Database Performance Tuning
Database Performance Tuning
 
OOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AASOOUG - Oracle Performance Tuning with AAS
OOUG - Oracle Performance Tuning with AAS
 
Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
 
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentalsDB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
 
MySQL Query Optimization
MySQL Query OptimizationMySQL Query Optimization
MySQL Query Optimization
 
Regression Test Old ETL
Regression Test Old ETLRegression Test Old ETL
Regression Test Old ETL
 
Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning Oracle Oracle Performance Tuning
Oracle Oracle Performance Tuning
 
Oracle db performance tuning
Oracle db performance tuningOracle db performance tuning
Oracle db performance tuning
 
Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014Ash architecture and advanced usage rmoug2014
Ash architecture and advanced usage rmoug2014
 
PostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter TuningPostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter Tuning
 

Similar to Pssdiag and sql nexus

Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
pasalapudi123
 
Sql server-performance-hafi
Sql server-performance-hafiSql server-performance-hafi
Sql server-performance-hafi
zabi-babi
 
Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502
kaziul Islam Bulbul
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 

Similar to Pssdiag and sql nexus (20)

SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
 
Best practices for_large_oracle_apps_r12_implementations
Best practices for_large_oracle_apps_r12_implementationsBest practices for_large_oracle_apps_r12_implementations
Best practices for_large_oracle_apps_r12_implementations
 
Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suiteGetting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suite
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
 
Database Performance Tuning| Rahul Gulab Singh
Database Performance Tuning| Rahul Gulab SinghDatabase Performance Tuning| Rahul Gulab Singh
Database Performance Tuning| Rahul Gulab Singh
 
Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008Ajuste (tuning) del rendimiento de SQL Server 2008
Ajuste (tuning) del rendimiento de SQL Server 2008
 
SQL Server Performance Analysis
SQL Server Performance AnalysisSQL Server Performance Analysis
SQL Server Performance Analysis
 
Sql server-performance-hafi
Sql server-performance-hafiSql server-performance-hafi
Sql server-performance-hafi
 
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and DeltaBest Practices for Building Robust Data Platform with Apache Spark and Delta
Best Practices for Building Robust Data Platform with Apache Spark and Delta
 
Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502Collaborate 2011-tuning-ebusiness-416502
Collaborate 2011-tuning-ebusiness-416502
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
 
Analyzing and Interpreting AWR
Analyzing and Interpreting AWRAnalyzing and Interpreting AWR
Analyzing and Interpreting AWR
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
MySQL Monitoring Mechanisms
MySQL Monitoring MechanismsMySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
OOW13 Exadata and ODI with Parallel
OOW13 Exadata and ODI with ParallelOOW13 Exadata and ODI with Parallel
OOW13 Exadata and ODI with Parallel
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
6 tips for improving ruby performance
6 tips for improving ruby performance6 tips for improving ruby performance
6 tips for improving ruby performance
 

More from Harsh Chawla (8)

Alwayson AG enhancements
Alwayson AG enhancementsAlwayson AG enhancements
Alwayson AG enhancements
 
Windows clustering and quorum basics
Windows clustering and quorum basicsWindows clustering and quorum basics
Windows clustering and quorum basics
 
AlwaysON Basics
AlwaysON BasicsAlwaysON Basics
AlwaysON Basics
 
AlwaysON FCI
AlwaysON FCIAlwaysON FCI
AlwaysON FCI
 
Query tuning optimization
Query tuning optimizationQuery tuning optimization
Query tuning optimization
 
Storage spaces - for SQL Server Workloads
Storage spaces - for SQL Server WorkloadsStorage spaces - for SQL Server Workloads
Storage spaces - for SQL Server Workloads
 
Manage sql server proactively
Manage sql server proactivelyManage sql server proactively
Manage sql server proactively
 
SQL Azure DB - BCDR
SQL Azure DB - BCDRSQL Azure DB - BCDR
SQL Azure DB - BCDR
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
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...
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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
 
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
 
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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 

Pssdiag and sql nexus