history of database monitoring

153
Midnight January 28, 1986 Lives are on the line History of Database Monitoring My own experiences http://kylehailey.com [email protected]

Upload: kyle-hailey

Post on 24-Jan-2017

628 views

Category:

Software


0 download

TRANSCRIPT

Page 1: History of database monitoring

Midnight January 28, 1986 Lives are on the line

History of Database MonitoringMy own experiences

http://[email protected]

Page 2: History of database monitoring

History … 1988 6 1989 1990 1991 1992 7 1993 1994 1995 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 3: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 1993 1994 1995 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 4: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 1993 1994 1995 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 5: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 1993 1994 1995 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 6: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 1993 1994 1995 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 7: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits 1993 Patrol vs M2 1994 1995 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

M2

Page 8: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 9: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 1999 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 10: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 Statspack 8.1.6 top waits 1999 Spotlight 2000 2001 9 2002 2003 10 2005 10.2 2006 2008 200X 2016

Page 11: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 Statspack 8.1.6 top waits 1999 Spotlight 2000 Statspack 9iR2 top events 2001 9 2002 design OEM 10 2003 10 2005 10.2 2006 2008 200X 2016

Page 12: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 Statspack 8.1.6 top waits 1999 Spotlight 2000 Statspack 9iR2 top events 2001 9 2002 design OEM 10 2003 10 OEM 10 2005 10.2 Top Activity 2006 2008 200X 2016

Page 13: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 Statspack 8.1.6 top waits 1999 Spotlight 2000 Statspack 9iR2 top events 2001 9 2002 design OEM 10 2003 10 OEM 10 2005 10.2 Top Activity 2006 Ashmon 2008 DB Optimizer 200X YaaMs Delphix 2016

Page 14: History of database monitoring

History … 1988 6 1989 Utlbstat/utlestat 1990 joined 1991 1992 7 Waits Waits 1993 Patrol vs M2 1994 Tcl/Tk Europe Car 1995 Tcl/Tk waits 1996 1997 8 1998 Statspack 8.1.6 top waits 1999 Spotlight 2000 Statspack 9iR2 top events 2001 9 2002 design OEM 10 2003 10 OEM 10 2005 10.2 Top Activity 2006 Ashmon 2008 DB Optimizer 200X YaaMs Delphix 2016 Amazon

Page 15: History of database monitoring

Computer Performance

1. Interactive• Opaque: Static, idiosyncrasies

Vs• Fun : Graphic , informative

2. Sampling• Counters and ratios

Vs• Waits and sampling

3. Graphics• Spaghetti on the wall

Vs

• Intelligence in the interface

Page 16: History of database monitoring

Computer Performance

1. Interactive• Opaque: Static, idiosyncrasies

Vs• Fun : Graphic , informative

2. Sampling• Counters and ratios

Vs• Waits and sampling

3. Graphics• Spaghetti on the wall

Vs

• Intelligence in the interface

Page 17: History of database monitoring

Computer Performance

1. Interactive• Opaque: Static, idiosyncrasies

Vs• Fun : Graphic , informative

2. Sampling• Counters and ratios

Vs• Waits and sampling

3. Graphics• Spaghetti on the wall

Vs

• Intelligence in the interface

Page 18: History of database monitoring

Theme:

Let’s make performance tuning a video game

Page 19: History of database monitoring
Page 20: History of database monitoring

The journey of simplicity: Designing an Interface

Page 21: History of database monitoring

The journey of simplicity

1. Seems simple

“When you start looking at a problem and it seems really simple, you don’t really understand the complexity of the problem.” – Steve Jobs

Page 22: History of database monitoring

The journey of simplicity

1. Seems simple2. Realize it’s complex

Page 23: History of database monitoring

The journey of simplicity

1. Seems simple2. It’s complex 3. Create complex solution

“Then you get into the problem, and you see that it’s really complicated, and you come up with all these convoluted solutions. That’s sort of the middle, and that’s where most people stop.” – Steve Jobs

Page 24: History of database monitoring

The journey of simplicity

1. Seems simple2. It’s complex 3. Complex solution4. Complex solution is bad

Page 25: History of database monitoring

The journey of simplicity

1. Seems simple2. It’s complex 3. Complex solution4. Complex is bad5. Simple powerful is hard

“But the really great person will keep on going and find the key, the underlying principle of the problem — and come up with an elegant, really beautiful solution that works.” – Steve Jobs

Page 26: History of database monitoring

Simple can be harderthan complex.

You have to work hard to get your thinking clean to make it simple.

Page 27: History of database monitoring

Prototype & Iterate (Cary Millsap)

Page 28: History of database monitoring

Thought: images are running the world

Page 29: History of database monitoring

Computers (&DBs)- can be “black boxes”

Page 30: History of database monitoring

How do you get in?

Page 31: History of database monitoring

How do you get in?

Page 32: History of database monitoring

Wordstar

Page 33: History of database monitoring

Text Friction

Page 34: History of database monitoring

You log in, then what?

Page 35: History of database monitoring

1984 OK, UI can change everything

Page 36: History of database monitoring

Computer performance

Page 37: History of database monitoring

What’s inside?

OR

Page 38: History of database monitoring

How do you make good tools ?

Page 39: History of database monitoring

Prototype and Iterate

Page 40: History of database monitoring

Make it a video game !

Page 41: History of database monitoring

Utlbstat/Utlestat …

•Intrusive•Overwhelming•Ratios & Averages

rem $Header: utlbstat.sql 26-feb-96.19:20:51 gpongrac Exp $ bstat.sql Rem Copyright (c) 1988, 1996 by Oracle CorporationRem NAMEREM UTLBSTAT.SQLRem MODIFIEDRem khailey 03/15/99 - add current user fields to stats$date, bug 594266Rem jloaiza 10/14/95 - add tablespace sizeRem jloaiza 09/19/95 - add waitstatRem jloaiza 09/04/95 - add per second and background waitsRem drady 09/09/93 - merge changes from branch 1.1.312.2Rem drady 03/22/93 - merge changes from branch 1.1.312.1 Rem drady 08/24/93 - bug 173918Rem drady 03/04/93 - fix bug 152986 Rem glumpkin 11/16/92 - Renamed from UTLSTATB.SQL Rem glumpkin 10/19/92 - Renamed from BSTAT.SQL Rem jloaiza 01/07/92 - rework for version 7Rem mroberts 08/16/91 - fix view for v7 Rem rlim 04/29/91 - change char to varchar2 Rem Laursen 01/01/91 - V6 to V7 mergeRem Loaiza 04/04/89 - fix run dates to minutes instead of monthsRem Martin 02/22/89 - CreationRem Jloaiza 02/23/89 - changed table names, added dates, added param dumpRem

insert into stats$begin_event select * from v$system_event;insert into stats$begin_roll select * from v$rollstat;insert into stats$begin_file select * from stats$file_view;insert into stats$begin_dc select * from v$rowcache;insert into stats$begin_stats select * from v$sysstat;insert into stats$begin_lib select * from v$librarycache;insert into stats$begin_latch select * from v$latch;

Page 42: History of database monitoring
Page 43: History of database monitoring
Page 44: History of database monitoring
Page 45: History of database monitoring

1993 First Monitors - Patrol

Page 46: History of database monitoring

1993 Patrol on Dec 8400

Page 47: History of database monitoring

1993

Page 48: History of database monitoring

Roger Saunders

M2•Light Weight•

Page 49: History of database monitoring

Roger Saunders

M2•Light Weight•Direct Memory Access•

Page 50: History of database monitoring

Roger Saunders

M2•Light Weight•Direct Memory Access•Sampling

Page 51: History of database monitoring

1994 Light weight graphic : Tcl/Tk + M2

Page 52: History of database monitoring

1995 Tcl/Tk dynamic

Page 53: History of database monitoring

Monitor Everything Approach

Page 54: History of database monitoring

1995 Monitor Everything Approach

Page 55: History of database monitoring

Monitor Everything Approach

Page 56: History of database monitoring

Monitor Everything Approach

Page 57: History of database monitoring

Wait Events Became the Focus

Graphs created dynamically

Easy to destroy

Page 58: History of database monitoring

Wait Events Became the Focus

Graphs created dynamically

Easy to destroy

Page 59: History of database monitoring

Improvements

•Scale Graphs Equally

Eliminate:

•Background waits•Idle Waits •Extraneous waits•Wait counts

Page 60: History of database monitoring

log_file_switch_completion : increase log file size

http://oraperf.sourceforge.net/seminar/ex3_test_2.html

Centi-seconds

Page 61: History of database monitoring

free buffer waits : increase db_block_buffers

Page 62: History of database monitoring

log file sync : log file -> raw device

Page 63: History of database monitoring

db file sequential read : increase db_block_buffers

Page 64: History of database monitoring

write complete wait free buffer waits : increase db_block_buffersdb file sequential reads

Page 65: History of database monitoring

Final

Page 66: History of database monitoring

Tuning catproc.sql on version 7

Compulsive Tuning Disorder

Missing CPU usage to put into perspective

Page 67: History of database monitoring

1998 8.1.6 Statspack

•Kyle wanted M2 & Graphics•Connie wanted statspack•boss : neither !

•Connie did statspack •I left

Page 68: History of database monitoring

1998 8.1.6 Statspack

•Kyle wanted M2 & Graphics•Connie wanted statspack•boss : neither !

•Connie did statspack •I left

Page 69: History of database monitoring

1998 8.1.6 Statspack

•Kyle wanted M2 & Graphics•Connie wanted statspack•boss : neither !

•Connie did statspack •I left

Page 70: History of database monitoring

1998 8.1.6 Statspack

•Kyle wanted M2 & Graphics•Connie wanted statspack•boss : neither !

•Connie did statspack •I left

•In the mean time ….

Page 71: History of database monitoring

1

Page 72: History of database monitoring

2

Page 73: History of database monitoring

3

Page 74: History of database monitoring

4

Page 75: History of database monitoring

5

Page 76: History of database monitoring

6

Page 77: History of database monitoring

7

Page 78: History of database monitoring

8

Page 79: History of database monitoring

9

Page 80: History of database monitoring

10

Page 81: History of database monitoring

11

Page 82: History of database monitoring

1999 Spotlight

Page 83: History of database monitoring

Without Reading a Manual

• Handspring’s site crashed Nov 25, 1999• Biggest Sales Day of the Year• Library cache latch contention• No DBAs • Downloaded Quest’s Spotlight• Installed and Identified problem with Minutes• Solution in code fix

Page 84: History of database monitoring

Spotlight – Stacked Waits !

Page 85: History of database monitoring

Ratio of waits to CPU

• How do you get CPU?• CPU stats?

Centi-seconds

Page 86: History of database monitoring
Page 87: History of database monitoring

Session countCPU stackedNo wait groups

Page 88: History of database monitoring

EM v10 Proposed Perf Page (v4.1)

Page 89: History of database monitoring

Avoid Scrolling and Hiding Data

Page 90: History of database monitoring

OEM

Page 91: History of database monitoring

Sampling vs Counters

•Given a wait bottleneck• Which User• Which SQL• What object / file / block

•Not feasible with counters•Easy and cheap with Sampling : Multi-dimensional

Page 92: History of database monitoring

Before ASH:Before ASH:• Sessions v$sesstat, v$session_event

• # sessions x (# wait events + statistics)• Example (150 x (800+200) = 150,000 )

• SQL v$sql• Could be 10000s• Takes out latches that compete with other sql executions

• Objects V$segstat • Could be 1000s of objects

• Files v$filestat

Expensive !

Page 93: History of database monitoring

Multi-DimensionalMulti-Dimensional

Top ConsumersSessionUserObjectModule.ActionProgram ServiceClientWait

XTop Resources• CPU• Waits• Event

(800*)• I/O• File• Block

• Time

Top SQLSQL IDPlanChild#

X

And Aggregated over any time Period

Page 94: History of database monitoring

Multi-dimensionalMulti-dimensional

25 34 36 38 45 63 65 87 25 34 36 38 45 63 65 87

F1qcyh20550cfF1qcyh20550cf

fj6gjgsshtxyxfj6gjgsshtxyx

0cjsxw5ndqdbc0cjsxw5ndqdbc

8t8as9usk11qw8t8as9usk11qw

dr1rkrznhh95bdr1rkrznhh95b

10dkqv3kr8xa510dkqv3kr8xa5

38zhkf4jdyff438zhkf4jdyff4

298wmz1kxjs1m298wmz1kxjs1m

CPUCPUEnq: TX – row lock contention

Enq: TX – row lock contention

SQL*Net break/reset to client

SQL*Net break/reset to client

db file scattered read

db file scattered read

db file sequential read

db file sequential read

IO

Application

SQLSQL

Sessions

WaitsWaits

Service Service

Scott SystemUserUser

Program Program

Sys

Sqlplus Toad

GL OE

PackageProcedurePlanChild #

Page 95: History of database monitoring

Sampling vs Waits

Page 96: History of database monitoring

Statistic Lag Time

Copyright 2006 Kyle Hailey

CountersCounters

SamplesSamples

Slight LagsSlight Lags

Page 97: History of database monitoring

If you are not tuning for time, you are wasting time

Max CPU

(yard stick)

Top Activity Top Activity

SQLSQLSessionsSessions

LOADLOAD

Page 98: History of database monitoring

Cambrian Explosion :YaaMs

Page 99: History of database monitoring

Confio Ignite

Page 100: History of database monitoring

Dell Foglight

Page 101: History of database monitoring

Lab128

Page 102: History of database monitoring

D.side

Page 103: History of database monitoring

W-ASH

Page 104: History of database monitoring

Ashviewer

Page 105: History of database monitoring

emlite

Page 106: History of database monitoring

ASHmon

Page 107: History of database monitoring

MyOra

Page 108: History of database monitoring

Mumbai

Page 109: History of database monitoring

Precise

Page 110: History of database monitoring

Lighty

Page 111: History of database monitoring

Example Problem

How so you communicated quantive data ?

Page 112: History of database monitoring

Midnight January 28, 1986 Lives are on the line

Thanks to Edward Tufte

Night before the Flight

Jan 27,1986

Page 113: History of database monitoring

Estimated launch temperature 29º

Page 114: History of database monitoring

13 Pages Faxed

Page 115: History of database monitoring

13 Pages Faxed

3 different types of names

Page 116: History of database monitoring

Damage (in overwhelming detail) but No Temperatures

13 Pages Faxed

Page 117: History of database monitoring

13 Pages Faxed

Missing Data for 5 erosion damage flights

Blow by Damage

Test engines fired horizontally

Page 118: History of database monitoring

13 Pages Faxed

Shows “blow by”, not more important “erosion”

Damage at hottest and coldest launches* (of the flights shown)

Next day’s flight

Page 119: History of database monitoring

13 Pages Faxed

Predict Temperature

Recommendation

Page 120: History of database monitoring

55 65 7560 70 80

1

Original Engineering data

2

3

““damages atdamages atthe hottest the hottest and coldest and coldest Temperature” Temperature”

Would you launch?

Page 121: History of database monitoring
Page 122: History of database monitoring

Congressional Hearings Evidence

No Damage LegendDamage hard to read

Page 123: History of database monitoring

Congressional Hearings Evidence

Temperature correlation difficult

Page 124: History of database monitoring

55 65 7560 70 80

1

Original Data

2

3

Page 125: History of database monitoring

Clearer

1. Y-Axis amount of damage (not number of damage)55 65 7560 70 80

4

8

12

Page 126: History of database monitoring

1. Y-Axis amount of damage (not number of damage)2. Include successes *

55 65 7560 70 80

4

8

12

Clearer

* Only external temperatures were known not the temperature of the solid rocket boosters

Be accurate enough

Page 127: History of database monitoring

1. Y-Axis amount of damage (not number of damage)2. Include successes3. Mark Differences

55 65 7560 70 80

4

8

12

Clearer

Page 128: History of database monitoring

1. Y-Axis amount of damage (not number of damage)2. Include successes3. Mark Differences4. Normalize same temp

55 65 7560 70 80

4

8

12

Clearer

Page 129: History of database monitoring

1. Y-Axis amount of damage (not number of damage)2. Include successes3. Mark Differences4. Normalize same temp

55 65 7560 70 80

4

8

12

Clearer

Damage on every flight below 65

No damage on every flight above 75

Page 130: History of database monitoring

1. Y-Axis amount of damage (not number of damage)2. Include successes3. Mark Differences4. Normalize same temp

55 65 7560 70 80

4

8

12

Clearer

Known World

Page 131: History of database monitoring

1. Y-Axis amount of damage (not number of damage)2. Include successes3. Mark Differences4. Normalize same temp5. Scale known vs unknown

55 65 7560 70 80

4

8

12

4

8

12

30 40 5035 45

XX

Clearer

Page 132: History of database monitoring

Difficult

NASA Engineers FailCongressional Investigators FailData Visualization is Difficult

But …

Lack of Clarity can be devastating

Page 133: History of database monitoring

Visualization can be powerful

Page 134: History of database monitoring

“If I can't picture it, I can't understand it”

Anscombe's QuartetI II III IV

x y x y x y x y10 8.04 10 9.14 10 7.46 8 6.588 6.95 8 8.14 8 6.77 8 5.76

13 7.58 13 8.74 13 12.74 8 7.719 8.81 9 8.77 9 7.11 8 8.84

11 8.33 11 9.26 11 7.81 8 8.4714 9.96 14 8.1 14 8.84 8 7.046 7.24 6 6.13 6 6.08 8 5.254 4.26 4 3.1 4 5.39 19 12.5

12 10.84 12 9.13 12 8.15 8 5.567 4.82 7 7.26 7 6.42 8 7.915 5.68 5 4.74 5 5.73 8 6.89

Average 9 7.5 9 7.5 9 7.5 9 7.5Standard Deviation 3.31 2.03 3.31 2.03 3.31 2.03 3.31 2.03Linear Regression 1.33 1.33 1.33 1.33

- Albert Einstein- Albert Einstein

Page 135: History of database monitoring

Graphics for Anscombe’s Quartet

Page 136: History of database monitoring

Counties in US

> 3000 Counties > 50 pages

“The humans … are exceptionally good at parsing visual information.” Knowledge representation in cognitive science. Westbury, C. & Wilensky, U. (1998)

Page 137: History of database monitoring

Visualizations can also obfuscate

Page 138: History of database monitoring

Pretty Picture

Page 139: History of database monitoring

Spaghetti at the wall

Page 140: History of database monitoring

Spaghetti at the wall II

Page 141: History of database monitoring

Amazon Cloudwatch

Page 142: History of database monitoring

Imagine Trying to Drive your Car

And is updated once and hourAnd is updated once and hour

Or would you like it to Or would you like it to look …look …

Would you want your dashboard to look like :Would you want your dashboard to look like :

Page 143: History of database monitoring

If you are not tuning for time, you are wasting time

Page 144: History of database monitoring

When Developers say When Developers say

The Database is slowThe Database is slow

Page 145: History of database monitoring
Page 146: History of database monitoring
Page 147: History of database monitoring

AAS ~= 0AAS ~= 0

Page 148: History of database monitoring

Do You Want?

Engineering Data?Engineering Data?

Page 149: History of database monitoring

Pretty PicturesPretty Pictures

Do You Want?

Page 150: History of database monitoring

Clean and Clear Clean and Clear

? ? ? ? ? ? ? ? ? ?? ?

Do You Want?

Page 151: History of database monitoring

Summary• Textual statistics – difficult to parse• Pretty pictures misleading• Goal clear graphics powerful

[email protected]://kylehailey.com

Page 152: History of database monitoring

Summary• Textual statistics – difficult to parse• Pretty pictures misleading• Goal clear graphics powerful

Simple can be harderthan complex.

You have to work hard to get your thinking clean to make it simple.

Prototype & Iterate

[email protected]://kylehailey.com

Page 153: History of database monitoring

•END