database performance analysis with time series
DESCRIPTION
Showing how to use R and Time Series Analysis techniques to analyse performance and plan capacity and SLAs.TRANSCRIPT
ANALYZING ORACLE PERFORMANCE USING TIME SERIES MODELS
Chen (Gwen) Shapirahttp://prodlife.wordpress.com
Why?
• Abnormal Data• Changes• Trends• SLAs
See
• Techniques• Use Cases• Real Data
Techniques
Preparing Data
Time
x
0 20 40 60 80 100
050
100
150
Missing data
Discontinuity
Outlier
Trend
Trend
Moving Average Trend
Different Windows
Time
p
0 10 20 30 40 50
15
00
16
00
17
00
18
00
19
00
20
00
21
00
Remove Trend
Seasonality
-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
0 5 10 15 20 25
-0.2
0.0
0.2
0.4
0.6
0.8
1.0
Lag
AC
F
Correlogram
Seasonal Effect
5 10 15 20
01
23
45
Hourly CPU Utilization Average
Hour
Ave
rag
e U
tiliza
tio
n
Components
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
Xt = 0.33Xt-1 + 0.07Xt-2 – 0.09Xt-3 + e
Test Model
Use Cases
Fake Incident
Detect By
• Remove trend• Remove Seasonality• Mark “normal data”• What’s left?
Spot the Incident
Time
fc_
nt_
ns
0 100 200 300 400 500 600 700
-20
24
“I have seen the future and it is very much like the present, only longer”
Kehlog Albran
Exponential Smoothing
• Calculate moving average of future• Add seasonality
Holt-Winters filtering
Time
Ob
se
rve
d / F
itte
d
2 4 6 8 10 12 14
55
60
65
70
75
80
AutoCorrelation
Use the model:Xt = aXt-1…To calculate Xt+1,Xt+2…
AR Model Prediction
Time
fc_
nt_
ns
550 600 650 700
-20
24
Real Data 1:Redo Blocks per Hour
Holiday
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
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
Real Data 2:CPU on DB Server
Seasonality?
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
Check Fit of Model
PredictionAR Model Prediction
Time
cp
u2
600 650 700 750 800 850 900
-10
01
02
03
04
05
0
Conclusions
• Use moving average to describe trend• Look for seasonality• Predict with Exponential Smoothing• AutoCorrelation?• Seasonality aware monitoring
Questions?