database performance analysis with time series

39
ANALYZING ORACLE PERFORMANCE USING TIME SERIES MODELS Chen (Gwen) Shapira http://prodlife.wordpress .com

Upload: chen-gwen-shapira

Post on 26-Jan-2015

121 views

Category:

Technology


3 download

DESCRIPTION

Showing how to use R and Time Series Analysis techniques to analyse performance and plan capacity and SLAs.

TRANSCRIPT

Page 1: Database Performance Analysis with Time Series

ANALYZING ORACLE PERFORMANCE USING TIME SERIES MODELS

Chen (Gwen) Shapirahttp://prodlife.wordpress.com

Page 2: Database Performance Analysis with Time Series

Why?

• Abnormal Data• Changes• Trends• SLAs

Page 3: Database Performance Analysis with Time Series

See

• Techniques• Use Cases• Real Data

Page 4: Database Performance Analysis with Time Series

Techniques

Page 5: Database Performance Analysis with Time Series

Preparing Data

Time

x

0 20 40 60 80 100

050

100

150

Missing data

Discontinuity

Outlier

Page 6: Database Performance Analysis with Time Series

Trend

Page 7: Database Performance Analysis with Time Series

Trend

Page 8: Database Performance Analysis with Time Series

Moving Average Trend

Page 9: Database Performance Analysis with Time Series

Different Windows

Time

p

0 10 20 30 40 50

15

00

16

00

17

00

18

00

19

00

20

00

21

00

Page 10: Database Performance Analysis with Time Series

Remove Trend

Page 11: Database Performance Analysis with Time Series

Seasonality

Page 12: Database Performance Analysis with Time Series

-2 -1 0 1 2

15

00

16

00

17

00

18

00

19

00

20

00

21

00

Correlation

Theoretical Quantiles

Sa

mp

le Q

ua

ntil

es

Page 13: Database Performance Analysis with Time Series

0 5 10 15 20 25

-0.2

0.0

0.2

0.4

0.6

0.8

1.0

Lag

AC

F

Correlogram

Page 14: Database Performance Analysis with Time Series

Seasonal Effect

5 10 15 20

01

23

45

Hourly CPU Utilization Average

Hour

Ave

rag

e U

tiliza

tio

n

Page 15: Database Performance Analysis with Time Series

Components

Page 16: Database Performance Analysis with Time Series

More AutoCorrelation

0 5 10 15 20 25

0.0

0.2

0.4

0.6

0.8

1.0

Lag

AC

F

Autocorrelation without Seasonality

Page 17: Database Performance Analysis with Time Series

Xt = 0.33Xt-1 + 0.07Xt-2 – 0.09Xt-3 + e

Page 18: Database Performance Analysis with Time Series

Test Model

Page 19: Database Performance Analysis with Time Series

Use Cases

Page 20: Database Performance Analysis with Time Series

Fake Incident

Page 21: Database Performance Analysis with Time Series

Detect By

• Remove trend• Remove Seasonality• Mark “normal data”• What’s left?

Page 22: Database Performance Analysis with Time Series

Spot the Incident

Time

fc_

nt_

ns

0 100 200 300 400 500 600 700

-20

24

Page 23: Database Performance Analysis with Time Series

“I have seen the future and it is very much like the present, only longer”

Kehlog Albran

Page 24: Database Performance Analysis with Time Series

Exponential Smoothing

• Calculate moving average of future• Add seasonality

Page 25: Database Performance Analysis with Time Series

Holt-Winters filtering

Time

Ob

se

rve

d / F

itte

d

2 4 6 8 10 12 14

55

60

65

70

75

80

Page 26: Database Performance Analysis with Time Series

AutoCorrelation

Use the model:Xt = aXt-1…To calculate Xt+1,Xt+2…

Page 27: Database Performance Analysis with Time Series

AR Model Prediction

Time

fc_

nt_

ns

550 600 650 700

-20

24

Page 28: Database Performance Analysis with Time Series

Real Data 1:Redo Blocks per Hour

Page 29: Database Performance Analysis with Time Series

Holiday

Page 30: Database Performance Analysis with Time Series

0 5 10 15 20 25

-0.2

0.0

0.2

0.4

0.6

0.8

1.0

Lag

AC

F

Auto-Correlation of Redo Data

Seasonality

Page 31: Database Performance Analysis with Time Series

Abnormal DataRedo Generation without Seasonality

Time

x_

ns

0 100 200 300 400

-4e

+0

6-2

e+

06

0e

+0

02

e+

06

4e

+0

66

e+

06

8e

+0

6

Page 32: Database Performance Analysis with Time Series

Real Data 2:CPU on DB Server

Page 33: Database Performance Analysis with Time Series
Page 34: Database Performance Analysis with Time Series

Seasonality?

Page 35: Database Performance Analysis with Time Series

Partial AutoCorrelation

0 5 10 15 20 25 30

0.0

0.2

0.4

0.6

Lag

Pa

rtia

l A

CF

Partial Correlogram

Page 36: Database Performance Analysis with Time Series

Check Fit of Model

Page 37: Database Performance Analysis with Time Series

PredictionAR Model Prediction

Time

cp

u2

600 650 700 750 800 850 900

-10

01

02

03

04

05

0

Page 38: Database Performance Analysis with Time Series

Conclusions

• Use moving average to describe trend• Look for seasonality• Predict with Exponential Smoothing• AutoCorrelation?• Seasonality aware monitoring

Page 39: Database Performance Analysis with Time Series

Questions?