SlideShare a Scribd company logo
PERFORMANCE TUNING FOR
PIRATES!

John Sterrett (@JohnSterrett)
HTTP://JOHNSTERRETT.COM/GO/PERFORMANCE
ABOUT John…

I am a Remote DBA Expert
• Responsible 100+ Instances of SQL Server
• Senior DBA on Integration Team
Mid-Atlantic Region Mentor
Founder of WVPASS (SQL UG)
Host of SQL Saturday #36 and #80
I reside in Wheeling, WV (Pittsburgh, PA)




                                             2
Pirates and Yankees




Photos: http://www.flickr.com/photos/jaubele1/4299542394/ and http://www.flickr.com/photos/wenzday01/2537854102

                                                                                                                  3
Objectives

•   Eliminate the Obvious
•   Know the process
•   Know the common bottlenecks
•   Know your Tools
    –   Wait Stats
    –   Performance Monitor & PAL (WMI Counters)
    –   DMV’s and scripts
    –   SQL Server Side Trace (SQL Profiler)
    –   Clear Trace
    –   SQL Diag
    –   SQL Nexus
    –   RML Utilities
        •   ReadTrace
        •   Ostress
• Know where to go for help...

                                                   4
Eliminate the Obvious




                        5
Eliminate the OBVIOUS




    http://theiphonefever.blogspot.com/2010/10/movies-you-should-watch-office-space.html

                                                                                           6
Know the process!


                   Generate
                   workload



          Make                Capture
         Changes              workload



                    Analyze
                   captured
                   workload


                                         7
12 Steps to workload Tuning




                              8
12 Steps to workload Tuning

1. Backup Production Database




                                9
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload




                                 10
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)

  *** Done with Production ***




                                                11
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)
4. Restore Backup on Test Server




                                                12
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server




                                                13
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server




                                                14
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server
7. Analyze to Establish Baseline




                                                15
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server
7. Analyze to Establish Baseline
8. Restore Backup on Test Server


                                                16
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t
   Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server
7. Analyze to Establish Baseline
8. Restore Backup on Test Server
9. Make Changes to Improve Performance on Test Server

                                               17
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server
7. Analyze to Establish Baseline
8. Restore Backup on Test Server
9. Make Changes to Improve Performance on Test Server
10. Prepare to Capture Production Workload on Test Server


                                                     18
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server
7. Analyze to Establish Baseline
8. Restore Backup on Test Server
9. Make Changes to Improve Performance on Test Server
10. Prepare to Capture Production Workload on Test Server
11. Replay Workload on Test Server

                                                     19
12 Steps to workload Tuning

1. Backup Production Database
2. Capture Production Workload
3. Analyze Workload and Script Changes (Don’t Implement)
4. Restore Backup on Test Server
5. Prepare to capture Workload on Test Server
6. Replay Production Workload on Test Server
7. Analyze to Establish Baseline
8. Restore Backup on Test Server
9. Make Changes to Improve Performance on Test Server
10. Prepare to Capture Production Workload on Test Server
11. Replay Workload on Test Server
12. Analyze and Compare Workload with Baseline
   *** Repeat Steps 8 to 12 as needed ***
                                                      20
Where can things Go wrong?




                             21
Meet the Bottlenecks




      MEMORY                                      DISK (SPINDLES)                                                        CPU




                    NETWORK                                  LOCKING, BLOCKING & DEADLOCKS
Photos: http://www.flickr.com/photos/kaiban/5159888367/lightbox/ and http://www.flickr.com/photos/moodog/504456253 and
http://www.flickr.com/photos/marksze/4231115464 and http://www.flickr.com/photos/vvvracer/5264339383 and
http://www.flickr.com/photos/iphil_photos/4962369046

                                                                                                                          22
3 Options To Resolve bottlenecks




                                   23
3 Options To Resolve bottlenecks



1. Reduce Workload




                                   24
3 Options To Resolve bottlenecks



1. Reduce Workload
2. Tune Workload to reduce bottleneck resource




                                                 25
3 Options To Resolve bottlenecks



1. Reduce Workload
2. Tune Workload to reduce bottleneck resource
3. Add additional Hardware




                                                 26
Viewing Wait Stats

• Sys.dm_os_wait_stats
• Wait stats can be cleared manually or during restart.
  – DBCC SQLPERF(‘sys.dm_os_wait_stats’, CLEAR)
• Focus on waits dedicated to bottlenecks




                                                     27
Common WAIT STATS

•   ASYNC_NETWORK_IO
•   LCK_M_*
•   IO_COMPLETION
•   PAGELATCH_* or PAGEIOLATCH_*
•   WRITELOG
•   CX_PACKET
•   SOS_SCHEDULER_YIELD




                                   28
DEMO!!!!




• Review Wait Statistics

                           29
Memory Performance counters


                                                         You Want    Description
Object                       Counter
                                                         > 256 MB    Unused physical memory
Memory                       Available Mbytes
                                                         < 10        Reads from hard disk per second to memory
Memory                       Pages Input/sec
                                                         > 300       On average, how many seconds SQL Server expects page to say in cache
                                                                     (memory)
SQL Server: Buffer Manager   Page Life Expectancy
                                                                     Shows amount of memory SQL Server is currently using.
SQL Server: Memory Manager   Total Server Memory (KB)
                                                                     Amount of memory that SQL Server wants to use based on configured max
                                                                     Server Memory setting
SQL Server: Memory Manager   Target Server Memory (KB)
                                                                    0 Total number of processess pers second waiting for workspace memory grants
SQL Server: Memory Manager   Memory Grants Pending
                                                         > 640       Total number of pages avaiable across all free lists. A value under 640
SQL Server: Buffer Manager   Free Pages
                                                         < 20        Number of times per second that the lazywritter process moves dirty page from
                                                                     buffer to disk.
SQL Server: Buffer Manager   LazyWrites/Sec




                                                                                                                                 30
Disk Performance Counters


     • The sys.dm_io_virtual_file_stats DMV can be used to get disk latency for
       individual sql server files.


Object          Counter              You Want   Description


                                                Avg. Disk sec/Read is the average time, in seconds, of a read of data from the disk.This
                                                analysis determines if any of the physical disks are responding slowly.


Physical Disk   Avg Disk Sec/Read    < 25ms
                                                Avg. Disk sec/Write is the average time, in seconds, of a write of data to the disk.

Physical Disk   Avg Disk Sec/Write   < 25ms
                                                Disk Reads/sec is the rate of read operations on the disk.
Physical Disk   Disk Reads/sec
                                                Disk Writes/sec is the rate of write operations on the disk.
Physical Disk   Disk Writes/sec




                                                                                                                             31
CPU Performance Counters




Object               Counter           You Want   Description


                                       < 80%      Percentage of processor time spent on SQL Server process threads.
Process (sqlservr)   %Processor Time
                                       < 80%      Percentage of elapsed time the processor spends executing non-idle threads.
Processor            %Processor Time




                                                                                                                                32
General Workload performance
 counters
Object                       Counter                   You Want                     Description

                                                                                    Number of SQL batch requests received by server. This counter
                                                                                    measures the number of batch requests that SQL Server receives per
                             Batch Requests/Sec                                     second, and generally follows in step to how busy your server's CPUs
SQL Server: SQL Statistics   (SQL2005/08)                                           are.
                                                       < 10% of the number of       Number of SQL compilations.
SQL Server: SQL Statistics   SQL Compilations/sec      batch request/sec
                                                       < 10% of the number of       Number of SQL re-compiles. This needs to be 0 as much as possible. A
                                                       compilations/sec             recompile can cause deadlocks and compile locks that are not
SQL Server: SQL Statistics   SQL Re-Compilations/sec                                compatible with any locking type.

SQL Server: SQL Statistics   User Connections
                                                       1 Full scan for every 1000   This counter monitors the number of full scans on base tables or
                                                       index searches               indexes. High values indicate that we may be having performance
SQL Server: Access Methods Full Scans/sec                                           issues due to table / index page scans.
                                                                                    This counter measures the number of index searches per second. Index
                                                                                    searches are used to start range scans, single index record fetches, and
                                                                                    to reposition within an index. Index searches are preferable to index
SQL Server: Access Methods Index Searches/sec                                       and table scans.
                                                                                    Number of page splits per second that occur as a result of overflowing
                                                                                    index pages. Reduce non-sequential inserts or use fill factor and
SQL Server: Access Methods Page Splits/sec                                          pad_index to leave more empty space per page.




                                                                                                                                        33
Locking Performance Counters



Object                           Counter                      You Want   Description


                                                                         Number of lock requests per second
SQL Server: Locks                Number of Deadlocks/sec      <1         that resulted in deadlock.
                                                                         Number of times SQL escalated
                                                                         locks to table level. This can indicate
SQL Server: Locks                Table Lock Escalations/sec              poorly coded transactions.
                                                                         The average wait time for each lock
SQL Server: Locks                Avg Wait Time (ms)           < 500      request that had to wait.
                                                                         Number of currently blocked
SQL Server: General Statistics   Processes blocked                       processes.




                                                                                           34
DEMO!!!




• Review Perfmon
• Review PAL Tool
 – Collection Process
 – Generating Reports
 – Reviewing Reports
                        35
Execution DMV’s

• Sys.dm_exec_session
 – Returns one row per authenticated session, including user and
   system processes.
• Sys.dm_exec_requests
 – Returns one row for each request executing within SQL Server,
   doesn’t include code executed outside of SQL (distributed queries,
   extended stored procedures etc…)
• Sys.dm_exec_query_stats
 – Returns one row per query statement with cached plan, detailing
   aggregated performance stats for cached plans.
• Sys.dm_exec_connections
 – Returns server information about a connection to SQL Server
   including client network address, TCP Port etc..

                                                             36
Query details DMV’S

• Sys.dm_exec_sql_text
 – Returns the text of the SQL Server batch that is identified by
   specific sql handle.
• Sys.dm_exec_text_query_plan
 – Returns the showplan output in text format.
• Sys.dm_query_plan
 – Returns a given query’s showplan output in xml.




                                                               37
INDEX DMV’s

• Sys.dm_db_index_usage_stats
 – Returns a count of index operations including seeks, scans, lookup
   and updates
• Sys.dm_db_index_physical_stats
 – Returns size and fragmentation information for data pages and
   indexes.
• DMV’s to find recommended indexes
 –   Sys.dm_db_missing_index_columns
 –   Sys.dm_db_missing_index_details
 –   Sys.dm_db_missing_index_groups
 –   Sys.dm_db_missing_index_group_stats


                                                            38
SQLOS DMV’s

• Sys.dm_os_sys_memory
 – Returns complete picture of memory at the os level including total and
   available memory.
• Sys.dm_os_tasks
 – Returns a row for each OS task thais is active in the instance of SQL
   Server.
• Sys.dm_os_threads
 – Returns a row for each SQLOS thread running under the SQL Server
   process.
• Sys.dm_os_performance_counters
 – Returns a row for each SQL Server perfmon counter.
• Sys.dm_os_waiting_tasks
 – Returns information about the wait queue of SQLOS. This would be
   tasks waiting on resources like blocking and latch contention etc..

                                                                 39
DMV Queries (DEMO)




      http://www.flickr.com/photos/democonference/4458079104
• What is Running?
• Probing the Proc Cache

                                                               40
SQL Profiler (DEMO!)




      http://www.flickr.com/photos/democonference/4458079104
• Generate Server Side traces
 – Tuning Columns and Events
 – Remove the noise
• Read Trace with Clear Trace
                                                               41
SQL Diag (DEMO)




     http://www.flickr.com/photos/democonference/4458079104
• Review SQL Diag
• Review PerStats Scripts
• Collect perfmon, sql trace, blocking and more…
                                                              42
SQL NEXUS (DEMO)




       http://www.flickr.com/photos/democonference/4458079104
• Import SQLDiag
• Analysis collected data

                                                                43
RML Utilities (DEMO)




      http://www.flickr.com/photos/democonference/4458079104

• Ostress (Replay)
• ReadTrace (Compare Workload to Baseline)
                                                               44
Help I need Some One!!!!

• Performance Virtual Chapter
  – http://performance.sqlpass.org/
• Twitter (#sqlhelp)
• Message boards
  – www.sqlservercentral.com
  – www.msdn.com
• Blogs
• Consultants




                                      45
Where to go next?

• HTTP://JOHNSTERRETT.COM/GO/PERFORMANCE
 – Videos
 – Reference Links
 – Slides




                                     46
Thank You to our Sponsors

More Related Content

What's hot

Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server Toolkit
Kevin Kline
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs
Antonios Chatzipavlis
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data bases
Roman Uholnikov
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
Manish Rawat
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
Bala Subra
 
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 queryAntonios Chatzipavlis
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your data
Neev Technologies
 
Oracle performance tuning_sfsf
Oracle performance tuning_sfsfOracle performance tuning_sfsf
Oracle performance tuning_sfsfMao Geng
 
SQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceSQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database Performance
Mark Ginnebaugh
 
Best Practices SQL 2005 SSIS
Best Practices SQL 2005 SSISBest Practices SQL 2005 SSIS
Best Practices SQL 2005 SSIS
ptolozah
 
SQL on Linux
SQL on LinuxSQL on Linux
SQL on Linux
Datavail
 
Weblogic plug in
Weblogic plug inWeblogic plug in
Weblogic plug in
Aditya Bhuyan
 
Analyzing SQL Server wait stats, hands-on!
Analyzing SQL Server wait stats, hands-on!Analyzing SQL Server wait stats, hands-on!
Analyzing SQL Server wait stats, hands-on!
Red Gate Software
 
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
Edwin M Sarmiento
 
Database change management with Liquibase
Database change management with LiquibaseDatabase change management with Liquibase
Database change management with Liquibase
Jarosław Szczepankiewicz
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
Aditya Bhuyan
 
SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)
Hamid J. Fard
 
Weblogic introduction
Weblogic introductionWeblogic introduction
Weblogic introduction
Aditya Bhuyan
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
Tim Berglund
 
Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2
Mahesh Dahal
 

What's hot (20)

Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server Toolkit
 
Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs Building diagnostic queries using DMVs and DMFs
Building diagnostic queries using DMVs and DMFs
 
Liquibase migration for data bases
Liquibase migration for data basesLiquibase migration for data bases
Liquibase migration for data bases
 
Sql server performance tuning and optimization
Sql server performance tuning and optimizationSql server performance tuning and optimization
Sql server performance tuning and optimization
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
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
 
Liquibase – a time machine for your data
Liquibase – a time machine for your dataLiquibase – a time machine for your data
Liquibase – a time machine for your data
 
Oracle performance tuning_sfsf
Oracle performance tuning_sfsfOracle performance tuning_sfsf
Oracle performance tuning_sfsf
 
SQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database PerformanceSQL Server Tuning to Improve Database Performance
SQL Server Tuning to Improve Database Performance
 
Best Practices SQL 2005 SSIS
Best Practices SQL 2005 SSISBest Practices SQL 2005 SSIS
Best Practices SQL 2005 SSIS
 
SQL on Linux
SQL on LinuxSQL on Linux
SQL on Linux
 
Weblogic plug in
Weblogic plug inWeblogic plug in
Weblogic plug in
 
Analyzing SQL Server wait stats, hands-on!
Analyzing SQL Server wait stats, hands-on!Analyzing SQL Server wait stats, hands-on!
Analyzing SQL Server wait stats, hands-on!
 
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
 
Database change management with Liquibase
Database change management with LiquibaseDatabase change management with Liquibase
Database change management with Liquibase
 
Weblogic performance tuning2
Weblogic performance tuning2Weblogic performance tuning2
Weblogic performance tuning2
 
SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)SQL Server High Availability Solutions (Pros & Cons)
SQL Server High Availability Solutions (Pros & Cons)
 
Weblogic introduction
Weblogic introductionWeblogic introduction
Weblogic introduction
 
Agile Database Development with Liquibase
Agile Database Development with LiquibaseAgile Database Development with Liquibase
Agile Database Development with Liquibase
 
Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2Mirroring in SQL Server 2012 R2
Mirroring in SQL Server 2012 R2
 

Similar to Performance Tuning for Pirates!

Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
LarryZaman
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQL
lefredbe
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
SPC Adriatics
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next Frontier
Kellyn Pot'Vin-Gorman
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
Morgan Tocker
 
Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
Richard Douglas
 
12 Steps to Workload Tuning
12 Steps to Workload Tuning12 Steps to Workload Tuning
12 Steps to Workload Tuning
John Sterrett
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11
Jess Coburn
 
Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012
Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012
Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012Michael Noel
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
Kellyn Pot'Vin-Gorman
 
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
Eduardo Castro
 
SQL Server Performance Analysis
SQL Server Performance AnalysisSQL Server Performance Analysis
SQL Server Performance Analysis
Eduardo Castro
 
Answering the Database Scale Out Problem with PCI SSDs
Answering the Database Scale Out Problem with PCI SSDsAnswering the Database Scale Out Problem with PCI SSDs
Answering the Database Scale Out Problem with PCI SSDs
answers
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledgesqlserver.co.il
 
Exchange Server 2013 Database and Store Changes
Exchange Server 2013 Database and Store ChangesExchange Server 2013 Database and Store Changes
Exchange Server 2013 Database and Store Changes
Microsoft TechNet - Belgium and Luxembourg
 
Sql Server 2005 Memory Internals
Sql Server 2005 Memory InternalsSql Server 2005 Memory Internals
Sql Server 2005 Memory Internals
Dmitry Geyzersky
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
hannonhill
 
Sql Health in a SharePoint environment
Sql Health in a SharePoint environmentSql Health in a SharePoint environment
Sql Health in a SharePoint environment
Enrique Lima
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACKristofferson A
 
WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide
WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning GuideWebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide
WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning GuideTan Nguyen Phi
 

Similar to Performance Tuning for Pirates! (20)

Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
Business_Continuity_Planning_with_SQL_Server_HADR_options_TechEd_Bangalore_20...
 
Loadays MySQL
Loadays MySQLLoadays MySQL
Loadays MySQL
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Denver SQL Saturday The Next Frontier
Denver SQL Saturday The Next FrontierDenver SQL Saturday The Next Frontier
Denver SQL Saturday The Next Frontier
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
 
12 Steps to Workload Tuning
12 Steps to Workload Tuning12 Steps to Workload Tuning
12 Steps to Workload Tuning
 
Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11Orlando DNN Usergroup Pres 12/06/11
Orlando DNN Usergroup Pres 12/06/11
 
Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012
Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012
Building the Perfect SharePoint 2010 Farm - MS Days Bulgaria 2012
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
 
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
 
Answering the Database Scale Out Problem with PCI SSDs
Answering the Database Scale Out Problem with PCI SSDsAnswering the Database Scale Out Problem with PCI SSDs
Answering the Database Scale Out Problem with PCI SSDs
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
 
Exchange Server 2013 Database and Store Changes
Exchange Server 2013 Database and Store ChangesExchange Server 2013 Database and Store Changes
Exchange Server 2013 Database and Store Changes
 
Sql Server 2005 Memory Internals
Sql Server 2005 Memory InternalsSql Server 2005 Memory Internals
Sql Server 2005 Memory Internals
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
 
Sql Health in a SharePoint environment
Sql Health in a SharePoint environmentSql Health in a SharePoint environment
Sql Health in a SharePoint environment
 
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RACPerformance Scenario: Diagnosing and resolving sudden slow down on two node RAC
Performance Scenario: Diagnosing and resolving sudden slow down on two node RAC
 
WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide
WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning GuideWebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide
WebSphere Portal Version 6.0 Web Content Management and DB2 Tuning Guide
 

More from John Sterrett

DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
John Sterrett
 
Getting Started with SQL Server Performance Tuning.pdf
Getting Started with SQL Server Performance Tuning.pdfGetting Started with SQL Server Performance Tuning.pdf
Getting Started with SQL Server Performance Tuning.pdf
John Sterrett
 
Workload Replay in the Cloud: Secret Weapon for Cloud Migrations
Workload Replay in the Cloud: Secret Weapon for Cloud MigrationsWorkload Replay in the Cloud: Secret Weapon for Cloud Migrations
Workload Replay in the Cloud: Secret Weapon for Cloud Migrations
John Sterrett
 
Introduction to High Availability with SQL Server
Introduction to High Availability with SQL ServerIntroduction to High Availability with SQL Server
Introduction to High Availability with SQL Server
John Sterrett
 
Introduction to PowerShell for DBA's
Introduction to PowerShell for DBA'sIntroduction to PowerShell for DBA's
Introduction to PowerShell for DBA'sJohn Sterrett
 
SQL Server Performance Root Cause Analysis in 10 Minutes
SQL Server Performance Root Cause Analysis in 10 MinutesSQL Server Performance Root Cause Analysis in 10 Minutes
SQL Server Performance Root Cause Analysis in 10 Minutes
John Sterrett
 
Table Partitioning: Secret Weapon for Big Data Problems
Table Partitioning: Secret Weapon for Big Data ProblemsTable Partitioning: Secret Weapon for Big Data Problems
Table Partitioning: Secret Weapon for Big Data ProblemsJohn Sterrett
 
Introduction to execution plan analysis
Introduction to execution plan analysisIntroduction to execution plan analysis
Introduction to execution plan analysisJohn Sterrett
 
Can You Host a SQL Saturday?
Can You Host a SQL Saturday?Can You Host a SQL Saturday?
Can You Host a SQL Saturday?
John Sterrett
 
Evaluating Daily Checklist Against 1000 Servers using Policy Based Management
Evaluating Daily Checklist Against 1000 Servers using Policy Based ManagementEvaluating Daily Checklist Against 1000 Servers using Policy Based Management
Evaluating Daily Checklist Against 1000 Servers using Policy Based Management
John Sterrett
 
SQL Server 2008 For Developers
SQL Server 2008 For DevelopersSQL Server 2008 For Developers
SQL Server 2008 For Developers
John Sterrett
 
Evaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMSEvaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMS
John Sterrett
 

More from John Sterrett (12)

DBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdfDBA Basics: Getting Started with Performance Tuning.pdf
DBA Basics: Getting Started with Performance Tuning.pdf
 
Getting Started with SQL Server Performance Tuning.pdf
Getting Started with SQL Server Performance Tuning.pdfGetting Started with SQL Server Performance Tuning.pdf
Getting Started with SQL Server Performance Tuning.pdf
 
Workload Replay in the Cloud: Secret Weapon for Cloud Migrations
Workload Replay in the Cloud: Secret Weapon for Cloud MigrationsWorkload Replay in the Cloud: Secret Weapon for Cloud Migrations
Workload Replay in the Cloud: Secret Weapon for Cloud Migrations
 
Introduction to High Availability with SQL Server
Introduction to High Availability with SQL ServerIntroduction to High Availability with SQL Server
Introduction to High Availability with SQL Server
 
Introduction to PowerShell for DBA's
Introduction to PowerShell for DBA'sIntroduction to PowerShell for DBA's
Introduction to PowerShell for DBA's
 
SQL Server Performance Root Cause Analysis in 10 Minutes
SQL Server Performance Root Cause Analysis in 10 MinutesSQL Server Performance Root Cause Analysis in 10 Minutes
SQL Server Performance Root Cause Analysis in 10 Minutes
 
Table Partitioning: Secret Weapon for Big Data Problems
Table Partitioning: Secret Weapon for Big Data ProblemsTable Partitioning: Secret Weapon for Big Data Problems
Table Partitioning: Secret Weapon for Big Data Problems
 
Introduction to execution plan analysis
Introduction to execution plan analysisIntroduction to execution plan analysis
Introduction to execution plan analysis
 
Can You Host a SQL Saturday?
Can You Host a SQL Saturday?Can You Host a SQL Saturday?
Can You Host a SQL Saturday?
 
Evaluating Daily Checklist Against 1000 Servers using Policy Based Management
Evaluating Daily Checklist Against 1000 Servers using Policy Based ManagementEvaluating Daily Checklist Against 1000 Servers using Policy Based Management
Evaluating Daily Checklist Against 1000 Servers using Policy Based Management
 
SQL Server 2008 For Developers
SQL Server 2008 For DevelopersSQL Server 2008 For Developers
SQL Server 2008 For Developers
 
Evaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMSEvaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMS
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 

Performance Tuning for Pirates!

  • 1. PERFORMANCE TUNING FOR PIRATES! John Sterrett (@JohnSterrett) HTTP://JOHNSTERRETT.COM/GO/PERFORMANCE
  • 2. ABOUT John… I am a Remote DBA Expert • Responsible 100+ Instances of SQL Server • Senior DBA on Integration Team Mid-Atlantic Region Mentor Founder of WVPASS (SQL UG) Host of SQL Saturday #36 and #80 I reside in Wheeling, WV (Pittsburgh, PA) 2
  • 3. Pirates and Yankees Photos: http://www.flickr.com/photos/jaubele1/4299542394/ and http://www.flickr.com/photos/wenzday01/2537854102 3
  • 4. Objectives • Eliminate the Obvious • Know the process • Know the common bottlenecks • Know your Tools – Wait Stats – Performance Monitor & PAL (WMI Counters) – DMV’s and scripts – SQL Server Side Trace (SQL Profiler) – Clear Trace – SQL Diag – SQL Nexus – RML Utilities • ReadTrace • Ostress • Know where to go for help... 4
  • 6. Eliminate the OBVIOUS http://theiphonefever.blogspot.com/2010/10/movies-you-should-watch-office-space.html 6
  • 7. Know the process! Generate workload Make Capture Changes workload Analyze captured workload 7
  • 8. 12 Steps to workload Tuning 8
  • 9. 12 Steps to workload Tuning 1. Backup Production Database 9
  • 10. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 10
  • 11. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) *** Done with Production *** 11
  • 12. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 12
  • 13. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 13
  • 14. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 14
  • 15. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 7. Analyze to Establish Baseline 15
  • 16. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 7. Analyze to Establish Baseline 8. Restore Backup on Test Server 16
  • 17. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 7. Analyze to Establish Baseline 8. Restore Backup on Test Server 9. Make Changes to Improve Performance on Test Server 17
  • 18. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 7. Analyze to Establish Baseline 8. Restore Backup on Test Server 9. Make Changes to Improve Performance on Test Server 10. Prepare to Capture Production Workload on Test Server 18
  • 19. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 7. Analyze to Establish Baseline 8. Restore Backup on Test Server 9. Make Changes to Improve Performance on Test Server 10. Prepare to Capture Production Workload on Test Server 11. Replay Workload on Test Server 19
  • 20. 12 Steps to workload Tuning 1. Backup Production Database 2. Capture Production Workload 3. Analyze Workload and Script Changes (Don’t Implement) 4. Restore Backup on Test Server 5. Prepare to capture Workload on Test Server 6. Replay Production Workload on Test Server 7. Analyze to Establish Baseline 8. Restore Backup on Test Server 9. Make Changes to Improve Performance on Test Server 10. Prepare to Capture Production Workload on Test Server 11. Replay Workload on Test Server 12. Analyze and Compare Workload with Baseline *** Repeat Steps 8 to 12 as needed *** 20
  • 21. Where can things Go wrong? 21
  • 22. Meet the Bottlenecks MEMORY DISK (SPINDLES) CPU NETWORK LOCKING, BLOCKING & DEADLOCKS Photos: http://www.flickr.com/photos/kaiban/5159888367/lightbox/ and http://www.flickr.com/photos/moodog/504456253 and http://www.flickr.com/photos/marksze/4231115464 and http://www.flickr.com/photos/vvvracer/5264339383 and http://www.flickr.com/photos/iphil_photos/4962369046 22
  • 23. 3 Options To Resolve bottlenecks 23
  • 24. 3 Options To Resolve bottlenecks 1. Reduce Workload 24
  • 25. 3 Options To Resolve bottlenecks 1. Reduce Workload 2. Tune Workload to reduce bottleneck resource 25
  • 26. 3 Options To Resolve bottlenecks 1. Reduce Workload 2. Tune Workload to reduce bottleneck resource 3. Add additional Hardware 26
  • 27. Viewing Wait Stats • Sys.dm_os_wait_stats • Wait stats can be cleared manually or during restart. – DBCC SQLPERF(‘sys.dm_os_wait_stats’, CLEAR) • Focus on waits dedicated to bottlenecks 27
  • 28. Common WAIT STATS • ASYNC_NETWORK_IO • LCK_M_* • IO_COMPLETION • PAGELATCH_* or PAGEIOLATCH_* • WRITELOG • CX_PACKET • SOS_SCHEDULER_YIELD 28
  • 29. DEMO!!!! • Review Wait Statistics 29
  • 30. Memory Performance counters You Want Description Object Counter > 256 MB Unused physical memory Memory Available Mbytes < 10 Reads from hard disk per second to memory Memory Pages Input/sec > 300 On average, how many seconds SQL Server expects page to say in cache (memory) SQL Server: Buffer Manager Page Life Expectancy Shows amount of memory SQL Server is currently using. SQL Server: Memory Manager Total Server Memory (KB) Amount of memory that SQL Server wants to use based on configured max Server Memory setting SQL Server: Memory Manager Target Server Memory (KB) 0 Total number of processess pers second waiting for workspace memory grants SQL Server: Memory Manager Memory Grants Pending > 640 Total number of pages avaiable across all free lists. A value under 640 SQL Server: Buffer Manager Free Pages < 20 Number of times per second that the lazywritter process moves dirty page from buffer to disk. SQL Server: Buffer Manager LazyWrites/Sec 30
  • 31. Disk Performance Counters • The sys.dm_io_virtual_file_stats DMV can be used to get disk latency for individual sql server files. Object Counter You Want Description Avg. Disk sec/Read is the average time, in seconds, of a read of data from the disk.This analysis determines if any of the physical disks are responding slowly. Physical Disk Avg Disk Sec/Read < 25ms Avg. Disk sec/Write is the average time, in seconds, of a write of data to the disk. Physical Disk Avg Disk Sec/Write < 25ms Disk Reads/sec is the rate of read operations on the disk. Physical Disk Disk Reads/sec Disk Writes/sec is the rate of write operations on the disk. Physical Disk Disk Writes/sec 31
  • 32. CPU Performance Counters Object Counter You Want Description < 80% Percentage of processor time spent on SQL Server process threads. Process (sqlservr) %Processor Time < 80% Percentage of elapsed time the processor spends executing non-idle threads. Processor %Processor Time 32
  • 33. General Workload performance counters Object Counter You Want Description Number of SQL batch requests received by server. This counter measures the number of batch requests that SQL Server receives per Batch Requests/Sec second, and generally follows in step to how busy your server's CPUs SQL Server: SQL Statistics (SQL2005/08) are. < 10% of the number of Number of SQL compilations. SQL Server: SQL Statistics SQL Compilations/sec batch request/sec < 10% of the number of Number of SQL re-compiles. This needs to be 0 as much as possible. A compilations/sec recompile can cause deadlocks and compile locks that are not SQL Server: SQL Statistics SQL Re-Compilations/sec compatible with any locking type. SQL Server: SQL Statistics User Connections 1 Full scan for every 1000 This counter monitors the number of full scans on base tables or index searches indexes. High values indicate that we may be having performance SQL Server: Access Methods Full Scans/sec issues due to table / index page scans. This counter measures the number of index searches per second. Index searches are used to start range scans, single index record fetches, and to reposition within an index. Index searches are preferable to index SQL Server: Access Methods Index Searches/sec and table scans. Number of page splits per second that occur as a result of overflowing index pages. Reduce non-sequential inserts or use fill factor and SQL Server: Access Methods Page Splits/sec pad_index to leave more empty space per page. 33
  • 34. Locking Performance Counters Object Counter You Want Description Number of lock requests per second SQL Server: Locks Number of Deadlocks/sec <1 that resulted in deadlock. Number of times SQL escalated locks to table level. This can indicate SQL Server: Locks Table Lock Escalations/sec poorly coded transactions. The average wait time for each lock SQL Server: Locks Avg Wait Time (ms) < 500 request that had to wait. Number of currently blocked SQL Server: General Statistics Processes blocked processes. 34
  • 35. DEMO!!! • Review Perfmon • Review PAL Tool – Collection Process – Generating Reports – Reviewing Reports 35
  • 36. Execution DMV’s • Sys.dm_exec_session – Returns one row per authenticated session, including user and system processes. • Sys.dm_exec_requests – Returns one row for each request executing within SQL Server, doesn’t include code executed outside of SQL (distributed queries, extended stored procedures etc…) • Sys.dm_exec_query_stats – Returns one row per query statement with cached plan, detailing aggregated performance stats for cached plans. • Sys.dm_exec_connections – Returns server information about a connection to SQL Server including client network address, TCP Port etc.. 36
  • 37. Query details DMV’S • Sys.dm_exec_sql_text – Returns the text of the SQL Server batch that is identified by specific sql handle. • Sys.dm_exec_text_query_plan – Returns the showplan output in text format. • Sys.dm_query_plan – Returns a given query’s showplan output in xml. 37
  • 38. INDEX DMV’s • Sys.dm_db_index_usage_stats – Returns a count of index operations including seeks, scans, lookup and updates • Sys.dm_db_index_physical_stats – Returns size and fragmentation information for data pages and indexes. • DMV’s to find recommended indexes – Sys.dm_db_missing_index_columns – Sys.dm_db_missing_index_details – Sys.dm_db_missing_index_groups – Sys.dm_db_missing_index_group_stats 38
  • 39. SQLOS DMV’s • Sys.dm_os_sys_memory – Returns complete picture of memory at the os level including total and available memory. • Sys.dm_os_tasks – Returns a row for each OS task thais is active in the instance of SQL Server. • Sys.dm_os_threads – Returns a row for each SQLOS thread running under the SQL Server process. • Sys.dm_os_performance_counters – Returns a row for each SQL Server perfmon counter. • Sys.dm_os_waiting_tasks – Returns information about the wait queue of SQLOS. This would be tasks waiting on resources like blocking and latch contention etc.. 39
  • 40. DMV Queries (DEMO) http://www.flickr.com/photos/democonference/4458079104 • What is Running? • Probing the Proc Cache 40
  • 41. SQL Profiler (DEMO!) http://www.flickr.com/photos/democonference/4458079104 • Generate Server Side traces – Tuning Columns and Events – Remove the noise • Read Trace with Clear Trace 41
  • 42. SQL Diag (DEMO) http://www.flickr.com/photos/democonference/4458079104 • Review SQL Diag • Review PerStats Scripts • Collect perfmon, sql trace, blocking and more… 42
  • 43. SQL NEXUS (DEMO) http://www.flickr.com/photos/democonference/4458079104 • Import SQLDiag • Analysis collected data 43
  • 44. RML Utilities (DEMO) http://www.flickr.com/photos/democonference/4458079104 • Ostress (Replay) • ReadTrace (Compare Workload to Baseline) 44
  • 45. Help I need Some One!!!! • Performance Virtual Chapter – http://performance.sqlpass.org/ • Twitter (#sqlhelp) • Message boards – www.sqlservercentral.com – www.msdn.com • Blogs • Consultants 45
  • 46. Where to go next? • HTTP://JOHNSTERRETT.COM/GO/PERFORMANCE – Videos – Reference Links – Slides 46
  • 47. Thank You to our Sponsors