the day after tomorrow; why you need to baseline - pass sql rally nordic - 2013

24
“The Day After Tomorrow”; why you need to baseline Richard Douglas Dell Software

Upload: richard-douglas

Post on 20-May-2015

186 views

Category:

Technology


1 download

DESCRIPTION

Presentation by Richard Douglas - @SQLRich - on baselining a SQL Server environment from the PASS SQL Rally conference held in Stockholm 2013. Abstract: Ensuring peak SQL Server performance isn’t always easy and requires a lot of work on the part of the DBA. To maintain the best-possible performance, you need to make sure you’re monitoring the right things. But how do you know if the figures you’re seeing are good or bad? Baseline comparisons can help, and in this educational session, SQL Server expert Richard Douglas will show you how to get the most from them. Richard will explain what a baseline is, why and when you need to take one, and how you can create one. You’ll also learn about a number of native Windows and SQL Server tools that will allow you to do just that. Read more: Presentations - 2013 | Richard Douglas - SQL Server Professional http://sql.richarddouglas.co.uk/presentations/presentations-2013#ixzz2kcBNBxMK

TRANSCRIPT

Page 1: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

“The Day After Tomorrow”;why you need to baseline

Richard DouglasDell Software

Page 2: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

Who’s this guy?

• Richard Douglas• Editor in Chief – ToadWorld.com• MCITPro• Maidenhead PASS Chapter Leader• Blog: http://SQL.RichardDouglas.co.uk• Twitter: @SQLRich• Email: [email protected]

Page 3: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

Agenda

• What is a “baseline”?• What is “benchmarking”?• Where do I start?• What should I capture?• What should I capture it with?• Summary

Page 4: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What is a “baseline”?• Typical state• Average over a time period• Multiple baselines

Why baseline?• Line in the sand• Usage patterns

A measurement or calculation

used as a basis for

comparison.

Page 5: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What is “benchmarking”?

Allows you to make informed decisions

A level by which something can be measured or judged

Page 6: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

Performance tuning lifecycle

Identify bottleneck

Create / update

baseline

Define goal

Deploy change

Develop / test

solution

Page 7: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

Obligatory analogy

Analyse

Make a cup of coffee

Make the best coffee

Make change

Decide on change

Page 8: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

When should I capture it?• Consider different baselines for different business periods

– Maintenance windows– Month/Quarter/Year end– Seasonal peaks

• After Windows and SQL Server patches

• After failovers / DR scenarios

• After any new project deployment

It depends

Page 9: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture?

System Configuration

Windows OS Counters

SQL Server Counters

Wait statistics

Page 10: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture?• Infrastructure diagrams.• Windows and SQL Server version information.• Driver information.• IO Subsystem information.• System catalogue information:

– Sys.configurations– Sys.databases– Sys.master_files

System configuration

Page 11: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture?Operating System / SQL Server Counters - Memory

• Memory: Available Mbytes• Paging File: %Usage• SQL Server Memory Manager: Target Server Memory(KB)• SQL Server Memory Manager: Total Server Memory(KB)• SQL Server Memory Manager: Memory Grants Pending• SQL Server Buffer Manager: Buffer cache hit ratio

SQL Server Buffer Manager: Page Life Expectancy• SQL Server Buffer Manager: Extension Page Unreferenced Time• SQL Server Buffer Manager: Database Pages• SQL Server Buffer Manager: Procedure Cache Pages

0

300PLE * 16 or 32

Page 13: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture?Operating System / SQL Server Counters - CPU

• Processor: % Processor Time

• Process: % Processor Time (SQLServr)

• System: Processor Queue Length

• System: Context Switches/Sec

• SQL Server SQL Statistics: SQL Compilations/Sec

• SQL Server SQL Statistics: SQL ReCompilations/Sec

LT 80%

LT 80%LT 12 goodideally LT 4LT 3000 goodideally LT 1500

Page 14: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture?Operating System / SQL Server Counters - IO

• Physical Disk: Current Disk Queue Length

• Physical Disk: Avg. Disk Sec/Read

• Physical Disk: Avg. Disk Sec/Write

• Physical Disk: Avg. Bytes/Read

• Physical Disk: Avg. Bytes/Write

?

LT 20ms

LT 10ms

Page 15: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

SAN Considerations• Virtualised storage

– How is it connected?– How many spindles?– How many other servers share this?

• Dynamic storage– Your data may move!!!!!

• What’s a good way to test for consistency?– Baseline your maintenance window(s)

Page 16: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture? SQL Server Counters

• SQL Server Access Method: Forwarded Records/Sec

• SQL Server Access Method: Page Splits/Sec

• SQL Server General Statistics: User Connections

• SQL Server SQL Statistics: Batch Requests/Sec

• SQL Server Buffer Manager: Page Reads/Sec

• SQL Server Buffer Manager: Page Writes/Sec

Ideally 0It depends*Beware pooling

LT 90LT 90 **

*Page splits include “regular” new page allocations** Cross reference this with Checkpoint and Lazy Writer counters

Page 17: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What should I capture?• Query information

– Understand the server workload– Consider exporting plans from the cache.

• Job information– Are my jobs taking longer?

• Wait statistics– What is SQL Server waiting on?

Page 18: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

What free tools can I capture it with?• Performance Monitor (OS + SQL Server Counters)

• Your favourite T-SQL editor - SSMS or Toad for SQL Server freeware (Dynamic Management Objects)

• Profiler / Extended events (Query information)

Page 19: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

How do I analyse?• Import data into Microsoft Excel

– http://www.toadworld.com/platforms/sql-server/w/wiki/10421.performance-monitor.aspx

– http://bit.ly/YXOfZD - Brent Ozar at SQLBits

Page 20: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

Demo

Page 21: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

Mature Information Management Processes

ReactiveProactive Analyze trends Set thresholds Predict problems Monitor end-user

response time Automate Mature problem,

configuration, change, asset and performance mgt processes

Fight fires Inventory Desktop sw

distribution Initiate

problem mgt process

Alert and event mgt

Monitor component availability

IT as a service provider

Define services, classes, pricing

Understand costs Guarantee SLAs Monitor and report

service availability Capacity

mgt

ServiceValue IT as strategic

business partner IT and business

metric linkage IT/business

collaboration improves business process

Real-time infrastructure

Business planning

Level 1

Level 2Level 3

Level 4

Chaotic Ad hoc Undocumented Unpredictable Multiple help

desks Minimal IT

operations User call

notification

Level 0

Tool Leverage

Manage IT as a Business

Service Delivery Process EngineeringOperational Process Engineering

Service and Account Management

Page 22: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

“The Day After Tomorrow”;why you need to baseline

• What a “baseline” is.• What “benchmarking” means.• How to plan your baseline.• How to choose your measures.• Native tools.

Summary

Page 23: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013
Page 24: The Day After Tomorrow; why you need to baseline - PASS SQL Rally Nordic - 2013

THANK YOU!• For attending this session and

PASS SQLRally Nordic 2013, Stockholm

Richard Douglas@SQLRich http://SQL.RichardDouglas.co.uk [email protected]