SlideShare a Scribd company logo
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.
Pssdiag and sql nexus
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

PPT
Sql server performance tuning and optimization
PPTX
Query Optimization in SQL Server
PPT
Sql server performance tuning
PDF
SQL Server Tuning to Improve Database Performance
PPTX
Sql server performance tuning
PDF
SQL Server Query Tuning Tips - Get it Right the First Time
PPTX
Ten query tuning techniques every SQL Server programmer should know
PDF
Why & how to optimize sql server for performance from design to query
Sql server performance tuning and optimization
Query Optimization in SQL Server
Sql server performance tuning
SQL Server Tuning to Improve Database Performance
Sql server performance tuning
SQL Server Query Tuning Tips - Get it Right the First Time
Ten query tuning techniques every SQL Server programmer should know
Why & how to optimize sql server for performance from design to query

What's hot (20)

PPTX
Columnstore Customer Stories 2016 by Sunil Agarwal
PPTX
SQL Server Query Optimization, Execution and Debugging Query Performance
PDF
Fatkulin hotsos 2014
PDF
Performance tuning in sql server
PPT
Sql Server Performance Tuning
PPTX
SQL Server Wait Types Everyone Should Know
PDF
SQL Server Performance Tuning Baseline
PPTX
Oracle performance tuning_sfsf
PDF
Remote Database Administration Services | Shreeyansh Technologies
PPTX
Database Performance Tuning
PPT
OOUG - Oracle Performance Tuning with AAS
PPTX
Top 10 tips for Oracle performance
PDF
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
PDF
MySQL Query Optimization
PDF
Regression Test Old ETL
PPTX
Oracle Oracle Performance Tuning
PDF
Oracle db performance tuning
PDF
Ash architecture and advanced usage rmoug2014
PPTX
PostgreSQL Hangout Parameter Tuning
PDF
Aioug vizag oracle12c_new_features
Columnstore Customer Stories 2016 by Sunil Agarwal
SQL Server Query Optimization, Execution and Debugging Query Performance
Fatkulin hotsos 2014
Performance tuning in sql server
Sql Server Performance Tuning
SQL Server Wait Types Everyone Should Know
SQL Server Performance Tuning Baseline
Oracle performance tuning_sfsf
Remote Database Administration Services | Shreeyansh Technologies
Database Performance Tuning
OOUG - Oracle Performance Tuning with AAS
Top 10 tips for Oracle performance
DB Time, Average Active Sessions, and ASH Math - Oracle performance fundamentals
MySQL Query Optimization
Regression Test Old ETL
Oracle Oracle Performance Tuning
Oracle db performance tuning
Ash architecture and advanced usage rmoug2014
PostgreSQL Hangout Parameter Tuning
Aioug vizag oracle12c_new_features
Ad

Similar to Pssdiag and sql nexus (20)

PPTX
SQL Server - High availability
PDF
Getting optimal performance from oracle e-business suite presentation
PDF
Best practices for_large_oracle_apps_r12_implementations
PDF
Getting optimal performance from oracle e business suite
PDF
Getting optimal performance from oracle e business suite(aioug aug2015)
PPTX
Database Performance Tuning| Rahul Gulab Singh
PDF
SQL Server Performance Analysis
PDF
Ajuste (tuning) del rendimiento de SQL Server 2008
PPTX
Sql server-performance-hafi
PDF
2020-TipsAndTrickssssasdfasdfasdfasdfasdf.pdf
PDF
Best Practices for Building Robust Data Platform with Apache Spark and Delta
PPT
Collaborate 2011-tuning-ebusiness-416502
PPT
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
PDF
Analyzing and Interpreting AWR
ODP
MySQL Monitoring Mechanisms
ODP
MySQL Monitoring Mechanisms
PPTX
SQL Explore 2012: P&T Part 1
PDF
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
PPTX
OOW13 Exadata and ODI with Parallel
PDF
Sherlock holmes for dba’s
SQL Server - High availability
Getting optimal performance from oracle e-business suite presentation
Best practices for_large_oracle_apps_r12_implementations
Getting optimal performance from oracle e business suite
Getting optimal performance from oracle e business suite(aioug aug2015)
Database Performance Tuning| Rahul Gulab Singh
SQL Server Performance Analysis
Ajuste (tuning) del rendimiento de SQL Server 2008
Sql server-performance-hafi
2020-TipsAndTrickssssasdfasdfasdfasdfasdf.pdf
Best Practices for Building Robust Data Platform with Apache Spark and Delta
Collaborate 2011-tuning-ebusiness-416502
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Analyzing and Interpreting AWR
MySQL Monitoring Mechanisms
MySQL Monitoring Mechanisms
SQL Explore 2012: P&T Part 1
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
OOW13 Exadata and ODI with Parallel
Sherlock holmes for dba’s
Ad

More from Harsh Chawla (8)

PPTX
Alwayson AG enhancements
PPTX
Windows clustering and quorum basics
PPTX
AlwaysON Basics
PDF
AlwaysON FCI
PPTX
Query tuning optimization
PPTX
Storage spaces - for SQL Server Workloads
PPTX
Manage sql server proactively
PPTX
SQL Azure DB - BCDR
Alwayson AG enhancements
Windows clustering and quorum basics
AlwaysON Basics
AlwaysON FCI
Query tuning optimization
Storage spaces - for SQL Server Workloads
Manage sql server proactively
SQL Azure DB - BCDR

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Encapsulation theory and applications.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Monthly Chronicles - July 2025
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Weekly Chronicles - August'25 Week I
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Understanding_Digital_Forensics_Presentation.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Spectral efficient network and resource selection model in 5G networks
Encapsulation theory and applications.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?

Pssdiag and sql nexus