Guerrilla Warfare? Guerrilla Tactics - Performance Testing MS SQL Server Applications



Similar documents
Microsoft SQL Server: MS Performance Tuning and Optimization Digital

SQL Server Performance Tuning and Optimization

About Me: Brent Ozar. Perfmon and Profiler 101

PERFORMANCE TUNING IN MICROSOFT SQL SERVER DBMS

SQL Server 2012 Optimization, Performance Tuning and Troubleshooting

Performance Tuning and Optimizing SQL Databases 2016

Module 15: Monitoring

General DBA Best Practices

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

Performance Monitoring with Dynamic Management Views

Optimizing Performance. Training Division New Delhi

Solving Performance Problems In SQL Server by Michal Tinthofer

Mind Q Systems Private Limited

VirtualCenter Database Performance for Microsoft SQL Server 2005 VirtualCenter 2.5

"Charting the Course... MOC AC SQL Server 2014 Performance Tuning and Optimization. Course Summary

SOLIDWORKS Enterprise PDM - Troubleshooting Tools

6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

Case Study: Load Testing and Tuning to Improve SharePoint Website Performance

Response Time Analysis

Introduction. Part I: Finding Bottlenecks when Something s Wrong. Chapter 1: Performance Tuning 3

SQL Server 2012 Database Administration With AlwaysOn & Clustering Techniques

Optimizing Your Database Performance the Easy Way

>>Dream, Strive and Achieve Victory>> SQL Server 2005/2008 DBA SSIS and SSRS Training Contact

SSIS Scaling and Performance

Administering Microsoft SQL Server 2012 Databases

Dynamics NAV/SQL Server Configuration Recommendations

Extending Your Use of Extended Events

Boost SQL Server Performance Buffer Pool Extensions & Delayed Durability

Monitoring and Diagnosing Oracle RAC Performance with Oracle Enterprise Manager. Kai Yu, Orlando Gallegos Dell Oracle Solutions Engineering

Only for Data Group Students Do not share with outsiders and do not use for commercial purposes.

The 5-minute SQL Server Health Check

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

Course 55144: SQL Server 2014 Performance Tuning and Optimization

The Complete Performance Solution for Microsoft SQL Server

Analyzing & Optimizing T-SQL Query Performance Part1: using SET and DBCC. Kevin Kline Senior Product Architect for SQL Server Quest Software

MOC 20462C: Administering Microsoft SQL Server Databases

Monitoring and Diagnosing Oracle RAC Performance with Oracle Enterprise Manager

One of the database administrators

Would-be system and database administrators. PREREQUISITES: At least 6 months experience with a Windows operating system.

Performance Counters. Microsoft SQL. Technical Data Sheet. Overview:

EZManage V4.0 Release Notes. Document revision 1.08 ( )

Course 20462C: Administering Microsoft SQL Server Databases

Module 8: Server Management

ONSITE TRAINING CATALOG

Inside Microsoft SQL Server 2005: The Storage Engine

Unicenter Database Management For Distributed RDBMS

Administering Microsoft SQL Server Databases

Response Time Analysis

Concurrency in SQL Server Kalen Delaney Solid Quality Learning Kalen Delaney

W I S E. SQL Server 2012 Database Engine Technical Update WISE LTD.

Jason S Wong Sr. DBA IT Applications Manager DBA Developer Programmer M.S. Rice 88, MBA U.H. 94(MIS)

Course Outline:

20462C: Administering Microsoft SQL Server Databases

MS SQL Server 2005 Data Collector. Status: 12/5/2008

SQL Server. DMVs in Action. Better Queries with. Dynamic Management Views MANNING IANW. STIRK. Shelter Island

A Performance Engineering Story

Administering Microsoft SQL Server Databases

Microsoft SQL Server performance tuning for Microsoft Dynamics NAV

20462 Administering Microsoft SQL Server Databases

Upon completion of the program, students are given a full support to take and pass Microsoft certification examinations.

MS-10775: Administering Microsoft SQL Server 2012 Databases. Course Objectives. Required Exam(s) Price. Duration. Methods of Delivery.

Java DB Performance. Olav Sandstå Sun Microsystems, Trondheim, Norway Submission ID: 860

SQL Server 2016 New Features!

Administering Microsoft SQL Server 2014 Databases

DBA 101: Best Practices All DBAs Should Follow

Predicting Change Outcomes Leveraging SQL Server Profiler

Oracle and Sybase, Concepts and Contrasts

$99.95 per user. SQL Server 2008/R2 Database Administration CourseId: 157 Skill level: Run Time: 47+ hours (272 videos)

Troubleshooting SQL Server Enterprise Geodatabase Performance Issues. Matthew Ziebarth and Ben Lin

DBMS / Business Intelligence, SQL Server

ADMINISTERING MICROSOFT SQL SERVER DATABASES

Administering Microsoft SQL Server Databases

10775 Administering Microsoft SQL Server Databases

Virtualisa)on* and SAN Basics for DBAs. *See, I used the S instead of the zed. I m pretty smart for a foreigner.

SQL Server 2012 Performance White Paper

SQL Server 2014 Performance Tuning and Optimization 55144; 5 Days; Instructor-led

READPAST & Furious: Transactions, Locking and Isolation

This presentation is an introduction to the SQL Server Profiler tool.

Administering Microsoft SQL Server Databases 20462C; 5 days

Professional SQL Server 2012 Internals and Troubleshooting

Before attending this course, participants should have:

SQL Server Performance Intelligence

Response Time Analysis

Perfmon counters for Enterprise MOSS

Administering Microsoft SQL Server Databases

ArcSDE for Microsoft SQL Server Administration. Rob Stauder, ESRI

VMware vcenter 4.0 Database Performance for Microsoft SQL Server 2008

PERFORMANCE TUNING WITH WAIT STATISTICS. Microsoft Corporation Presented by Joe Sack, Dedicated Support Engineer

Capacity Management for Oracle Database Machine Exadata v2

Course: Administering Microsoft SQL Server Databases Overview

Brief background What the presentation is meant to cover: Relational, OLTP databases the type that 90% of our applications use

Throwing Hardware at SQL Server Performance problems?

SQL diagnostic manager Management Pack for Microsoft System Center. Overview

$99.95 per user. SQL Server 2005 Database Administration CourseId: 152 Skill level: Run Time: 30+ hours (158 videos)

DATABASE ADMINISTRATION (DBA) SERVICES

Lecture 7: Concurrency control. Rasmus Pagh

Performance Monitoring AlwaysOn Availability Groups. Anthony E. Nocentino

System Copy GT Manual 1.8 Last update: 2015/07/13 Basis Technologies

Transcription:

Guerrilla Warfare? Guerrilla Tactics - Performance Testing MS SQL Server Applications Peter Marriott peter.marriott@catalystcomputing.co.uk @peter_marriott

About Me Working with RDBMSs since the late 80s (MS SQLServer, Oracle, Ingres and MySQL) Started as software developer Spent time as DBA and Systems administrator Consultant working with developers to improve application performance

Agenda Why Guerrilla Tactics? Getting to know the terrain Testing & Monitoring Capturing & Analysing SQL Statements Indexing & Statistics Locking & Row versioning Questions (at any point)

Why Guerrilla Tactics? Ideally Performance is designed in from day one You know the max and median load You have full size hardware for testing You have a full size database You have good monitoring software

Why Guerrilla Tactics? Who lives in the Ideal World? No new software on servers No money for monitoring software Not much help/documentation Not much time

Why Guerrilla Tactics? Planning the Campaign Aim What is the system suppose to achieve? Spies Users, developers, DBAs & Sysadmins Intelligence Tracing & monitoring tools Weapons Development & testing tools

Know the Terrain Data Volume Get as close to real data as possible Hardware Find out difference in behaviour between test and production Threads Get as close to production load as is reasonable on the hardware

Time (ms) Why It Matters 500 Response Time (ms) 400 300 200 100 0 Single - Small Data Single - Large Data Concurrent - Large Data Mean Response 90% Line

Time (ms) Transactions/min Why It Matters 1200 1000 800 600 400 200 0 Response Time VS Transaction Throughput 1 2 4 8 16 32 UI Threads Mean Response 90% Line Transactions/min 3000 2500 2000 1500 1000 500 0

Testing & Monitoring Demo Perfmon Activity Monitor Dynamic Management Views & Dynamic Management Functions

Testing & Monitoring OS - Perfmon: Must be member of Performance Log Users group And assign Log on as a batch job to that group Database Activity Monitor, DMVs & DMFs Counters cleared on SQLServer restart (or CLEAR) Requires VIEW SERVER STATE permission Some DMVs/DMFs can be limited to VIEW DATABASE STATE permission

Choosing your Battles Poor code Database set-up Application server set-up Hardware and Infrastructure All of the above?

Capturing & Analysing SQL Statements Demo SQLServer Profiler

Capturing & Analysing SQL Statements SQL Server Profiler Requires ALTER TRACE permission Don t remote desktop onto the server Pick events carefully Filter as necessary Run on a PC fast enough to take the load Set Application Name in connection string DBCC DROPCLEANBUFFERS Requires sysadmin fixed server role DBCC FREEPROCCACHE Requires ALTER SERVER STATE permission

Capturing & Analysing SQL Statements Analysing SQL Server Profiler output ClearTrace http://www.scalesql.com/cleartrace TraceAnalyzer http://www.dbsophic.com/traceanalyzer Roll your own SQL

Indexing & Statistics Index Fast way to find specific data Statistics Information about data Help database make decisions on finding data These have a cost

Indexing & Statistics Demo Database Engine Tuning Advisor

Indexing & Statistics Check for similar indexes / statistics Database Engine Tuning Advisor Requires sysadmin server role Retest!

Locking & Row versioning Locking Synchronize multi user access to data Main types of Locks Shared Allow other readers Update Reduce potential deadlocks Exclusive Prevent access to resource Intent Prevent higher level locks occurring

Locking Database Engine Isolation Levels Read uncommitted read uncommitted data Read committed read lock select duration Repeatable read read lock transaction duration Serializable stops changes that bring data into and out of read scope

Row versioning Row versioning Reader gets previously committed values without blocking

Row versioning Read Committed Snapshot Database wide setting Maintain committed data for read duration Snapshot isolation Database wide setting but set by session Maintain committed data for transaction duration Errors occur if there are update conflicts

Demo Row versioning

Row versioning Row versioning Database setting Behaviour change Helps with lock waits Overhead hits tempdb

Row versioning Read Committed Snapshot No code change Snapshot isolation Code change More error handling

Time (ms) Transactions/sec Row Versioning Results 4500 4000 3500 3000 2500 2000 1500 1000 500 0 1 2 5 10 25 50 125 250 Concurrent Users 120 100 80 60 40 20 0 Mean Response (ms) Throughput Mean Response (ms) Snapshot Throughput Snapshot

Summary Preparation Good tests - a lot of data + multiple threads Perfmon, Activity Monitor, DMVs & DMFs get high level picture Locking, IO, CPU issues? SQL Profiler Find hot spots - Hardest hit not slowest

Summary Action Necessary / Appropriate Indexes & Statistics Recode Denormalise maybe Normalise Cache Remove Scalar functions / Cursors Row Versioning

Questions? peter.marriott@catalystcomputing.co.uk @peter_marriott

Resources Slides and Demos http://blogs.catalystcomputing.co.uk/2010/10/guerrilla-warfare ClearTrace - http://www.scalesql.com/cleartrace TraceAnalyzer - http://www.dbsophic.com/traceanalyzer Brent Ozar - http://www.brentozar.com http://www.brentozar.com/sql/sql-server-performance-tuning http://www.brentozar.com/archive/2006/12/dba-101-using-perfmon-for-sql-performance-tuning http://sqlbits.com/agenda/event5/using_perfmon_and_profiler/default.aspx Quest Software (Web search and sign up to get) QuestSoftware-PerfmonPosterSQLServer.pdf The Art of Application Performance Testing O Reilly Performance Tuning with SQL Server Dynamic Management Views Redgate Microsoft SQL Server 2005 The Storage Engine MS Press Microsoft SQL Server 2008 Internals MS Press

Guerrilla Warfare? blogs.catalystcomputing.co.uk/2010/10/guerrilla-warfare peter.marriott@catalystcomputing.co.uk @peter_marriott