Code

initial
[rrdtool-all.git] / tutorial / lisa2010 / rrd-by-example / body.tex
1 \mode<presentation>
2 {
3   \usetheme{default} % no fancy navigation or anything ... 
4   \usecolortheme{tobi}
5   \usefonttheme{serif}   
6   \usepackage{lmodern}
7   \newcommand{\addgraph}[1]{\includegraphics[width=\textwidth]{ex/#1}}
8   \setbeamercovered{transparent=25}
9 \AtBeginSection[]
10 {
11    \begin{frame}
12      \begin{center}
13      \Large\textbf{\insertsection}
14    \end{center}
15    % \frametitle{Outline}
16 %      \tableofcontents[currentsection]
17    \end{frame}
18 }
19 }
20 \mode<article>
21 {
22   \usepackage{url}
23   \usepackage{graphicx}
24   \usepackage[colorlinks,hyperindex,plainpages=false]{hyperref}
25   \setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
26   \setlength{\parindent}{0pt}  
27   \usepackage{times}
28   \newcommand{\addgraph}[1]{\begin{center}\framebox{\includegraphics[width=0.9\textwidth]{ex/#1}}\end{center}}
29   \addtolength{\voffset}{-2.5cm}
30   \addtolength{\textheight}{4cm}
31 }
32 \usepackage{alltt}
33 \usepackage{listings}
34 \usepackage{svgcolor}
35 \usepackage[english]{babel}
36 \usepackage[latin1]{inputenc}
37 % or whatever
39 \usepackage[T1]{fontenc}
40 % Or whatever. Note that the encoding and the font should match. If T1
41 % does not look nice, try deleting the line with the fontenc.
43 \title
44 {RRDtool advanced Topics}
46 \author
47 {Tobias Oetiker}
49 \institute
50 {OETIKER+PARTNER AG}
52 \date[LISA 2010] % (optional, should be abbreviation of conference name)
53 {24th Large Installation System Administration Conference}
55 \mode<presentation>{\subject{RRDtool tutorial based on example use}}
57 \mode<presentation>{
58  \lstset{%
59    language=Perl,%
60    numbers=left,%
61    basicstyle=\ttfamily\footnotesize\color{black},%
62    keywordstyle=\color{darkgreen},%
63 %  identifyerstyle=\color{brown},%
64    commentstyle=\color{mediumpurple},%
65    stringstyle=\color{dimgray},
66    numberstyle=\ttfamily\scriptsize\color{darkgray},
67    showstringspaces=false
68  }
69 }
70 \mode<article>{
71  \lstset{%
72    language=Perl,%
73    numbers=left,%
74    basicstyle=\ttfamily\footnotesize,%
75    keywordstyle=\bfseries,%
76    numberstyle=\ttfamily\scriptsize,
77 %  identifyerstyle=\color{brown},%
78    commentstyle=\itshape,%
79    stringstyle=\color{black},
80    showstringspaces=false
81  }
82 }
84 \begin{document}
86 \mode<article>{\maketitle}
88 \begin{frame}<presentation>
89   \titlepage
90 \end{frame}
92 \mode<articel>{\tableofcontents}
94 \section{A different kind of Database}
96 \begin{frame}{creating a simple rrd}
97 \lstinputlisting[language=bash,firstline=0,lastline=11]{ex/create-first.sh}
98 One Datasource, 4 Round Robin Archives
99 \end{frame}
101 \begin{frame}{feeding data}
102 \lstinputlisting[language=bash,firstline=13,lastline=21]{ex/create-first.sh}
103 Feed in some data. One or several updates at once.
104 \end{frame}
106 \begin{frame}[allowframebreaks]{inside the database}
107 \lstinputlisting[language=xml,basicstyle=\ttfamily\scriptsize]{ex/create-first.xml}
108 \end{frame}
110 \mode<article>{
111 The xml dump of the rrd file shows an approximation of the on-disk
112 structure of the database. The rra database sections are re-ordered, so that
113 they are in chronological order with the oldest at the top. Also the
114 cdp sections are stored right after the header. The idea behind this
115 design is that data that get written on every update is as close
116 together as possible.}
118 \begin{frame}{rrd features}
119 \begin{itemize}[<+-| alert@+>]
120 \item optimized for time-series data
121 \item fixed size rotating data store
122 \item constant on-disk size
123 \item no maintenance
124 \item on the fly consolidation
125 \end{itemize}
126 \end{frame}
128 \begin{frame}[fragile]{on-disk structure}
129 \begin{alltt}
130 +-------------------------------+
131 | Static Header                 | \textrm{RRD cookie, DB cfg}
132 |-------------------------------|\pause 
133 : Data Source (DS) Definitions  : 
134 |-------------------------------|\pause
135 : RR Archive (RRA) Definitions  : 
136 |===============================|\pause
137 | Live Head                     | \textrm{last update time}
138 |-------------------------------|\pause 
139 : PDP Prep per DS               : \textrm{last value for diff}
140 |-------------------------------|\pause
141 : CDP Prep per RRA and DS       : \textrm{intermediate storage}
142 |-------------------------------|\pause
143 : RRA Pointers                  :
144 |===============================|\pause
145 : Round Robin Archives (RRA)    :
146 +-------------------------------+
147 \end{alltt}
148 \end{frame}
150 \begin{frame}{irregular data arrival intervals}
151 \lstinputlisting[language=bash,lastline=19]{ex/update-real.sh}
152 \end{frame}
154 \mode<article>{To try things out lets assume that data arrives at
155   irregular intervals. This is counter data. By synchronizing the
156   data values with the arrival time we should get a constant rate
157   stored in the database.}
159 \begin{frame}{database after the irregular updates}
160 \lstinputlisting[language=bash,firstline=20]{ex/update-real.sh}
161 \lstinputlisting[language=bash]{ex/update-real.txt}
163 \begin{itemize}[<+-| alert@+>]
164 \item rrdtool re-binning at work
165 \item major difference to a normal db
166 \item all bins contain 1.0
167 \item the time is the 'end-time' of the bin.
168 \end{itemize}
169 \end{frame}
171 \mode<article>{\newpage}
172 \begin{frame}{optimizing your rrds}
173 \begin{itemize}[<+-| alert@+>]
174 \item update of multi DS RRD is cheep
175 \item single update interval per RRD
176 \item RRD modification is expensive
177 \item RRD size and update performance are independent
178 \item RRA complexity affects update performance
179 \end{itemize}
180 \end{frame}
182 \mode<article>{As long as your system is small (a few hundred RRDs)
183   you should optimize for convenience. Only keep DSes together
184   in one RRD that are tightly bound. For everything else
185   create separate RRDs.}
187 \mode<article>{\newpage}
189 \begin{frame}{fetching data}
190 fetch is for reading data from an rrd
191 \lstinputlisting[language=bash,firstline=8,lastline=9]{ex/catch-fetch.sh}
192 \begin{itemize}[<+-| alert@+>]
193 \item one RRA with two 300s entries
194 \item one RRA with three 600s entries
195 \end{itemize}
196 \end{frame}
198 \begin{frame}[fragile]{playing catch with fetch}
199 first pull 300 seconds
200 \begin{verbatim}
201 > rrdtool fetch x.rrd -r 300 \
202   -s 1200000600 -e 1200000900 AVERAGE
204 1200000900: 4.0000000000e+01
205 1200001200: 5.0000000000e+01
206 \end{verbatim}
208 then pull 900 seconds
209 \begin{verbatim}
210 > rrdtool fetch x.rrd -r300 \
211   -s 1200000000 -e 1200000900 AVERAGE
213 1200000600: 2.5000000000e+01
214 1200001200: 4.5000000000e+01
215 \end{verbatim}
216 \end{frame}
218 \begin{frame}{fetch recap}
219 \begin{itemize}[<+-| alert@+>]
220 \item looking for complete coverage
221 \item resolution is only a suggestion
222 \item time stamp in output marks the END of the period
223 \item end-time differences caused problems
224 \item since 1.3, only the start-time is relevant for coverage
225 \item outside the rra everything is NaN
226 \end{itemize}
227 \end{frame}
229 \section{Graphing}
230 \begin{frame}[fragile]{rrdgraph syntax 101}
231 for graph command syntax, there are two basic rules:\pause
232 \begin{enumerate}
233 \item \texttt{-{}-options} start with a double dash\pause
234 \item graphing instructions start with a letter
235 \end{enumerate}
237 \pause
238 \begin{center}
239 \renewcommand{\tabcolsep}{0.4cm}
240 \renewcommand{\arraystretch}{2}
242 \begin{tabular}{|l|}\hline
243 \begin{minipage}[t]{0.7\textwidth}
244 \begin{alltt}
245 rrdtool graph \textit{output}
246    DEF:var=\textit{rrd}:\textit{DS}:\textit{AVARAGE}
247    LINE:var#\textit{hex-rgb-color}:Comment
249 \end{alltt}
250 \end{minipage}\\\hline
251 \end{tabular}
252 \end{center}
254 \texttt{DEF} and \texttt{LINE} are \emph{graphing instructions}.
255 \end{frame}
257 \mode<article>{The rrd graph command is the most versatile of all rrdtool
258   commands. It comes with its own little language, optimized for
259   drawing graphs. There are two kinds of arguments. The options
260   which start with a double-dash and the graphing instructions that
261   start with an uppercase letter.}
263 \begin{frame}{normal line}
264 \addgraph{LINE}
265 \end{frame}
267 \begin{frame}{lower limit}
268 \addgraph{LINE-lower}
269 \end{frame}
271 \mode<article>{Unless you are a banker and are you drawing stock diagrams,
272   make sure your graph displays the zero-y-value. Otherwise it is
273   pretty difficult to judge the meaning of the graph since perspective
274   is limited to the numbers on the y-axis.}
276 \begin{frame}{slope mode}
277 \addgraph{LINE-slope}
278 \end{frame}
280 \mode<article>{RRD graphs are pretty blocky. This is on purpose, since
281   the data is blocky too. The slope mode is a little concession. It
282   tilts the vertical connections between the 'blocks' by one pixel.}
284 \begin{frame}{anti-anti-aliasing: graph}
285 \addgraph{LINE-graph-mono}
286 \end{frame}
288 \begin{frame}{anti-anti-aliasing: font}
289 \addgraph{LINE-font-mono}
290 \end{frame}
292 \mode<article>{\newpage}
293 \begin{frame}{line width}
294 \addgraph{LINE-width}
295 \end{frame}
297 \begin{frame}{dashed line}
298 \addgraph{LINE-dash}
299 \end{frame}
301 \mode<article>{The numbers are an ON-OFF-ON-OFF-\ldots pattern. The
302   \texttt{dash-offset} property lets you shift the dashing of the line
303   to the right.}
305 \begin{frame}{DEF with :step}
306 \addgraph{DEF-step}
307 \end{frame}
310 \begin{frame}{DEF with :start}
311 \addgraph{DEF-start}
312 \end{frame}
313 \mode<article>{\newpage}
315 \begin{frame}{DEF with :reduce}
316 \addgraph{DEF-reduce}
317 \end{frame}
319 \begin{frame}{AREA simple}
320 \addgraph{AREA-simple}
321 \end{frame}
323 \mode<article>{\newpage}
324 \begin{frame}{two AREAs}
325 \addgraph{AREA-two}
326 \end{frame}
328 \begin{frame}{transparent AREA}
329 \addgraph{AREA-trans}
330 \end{frame}
332 \mode<article>{RRDtool creates real alpha transparency. You can set
333   the whole graph to be transparent by setting the 
334   graph CANVAS and BACKGROUND colors to transparent.}
336 \mode<article>{\newpage}
337 \begin{frame}{stacked AREA}
338 \addgraph{AREA-stack}
339 \end{frame}
341 \mode<article>{\newpage}
343 \begin{frame}{time shift}
344 \addgraph{SHIFT-simple}
345 \end{frame}
347 \begin{frame}{shifting with extra data}
348 \addgraph{SHIFT-startdef}
349 \end{frame}
351 \mode<article>{A normal \texttt{DEF} line requests exactly as much data as it
352 requires for drawing the graph. If you \texttt{SHIFT} the data, you
353 may want to adjust the data fetched accordingly.}
355 \mode<article>{\newpage}
356 \section{Revers Polish Notation (RPN) Math}
358 \mode<article>{RRDtool lets you apply math operations to the data
359   prior to showing it to the user. It uses RPN math for this. If you
360   ever owned a classic HP calculator, you may still remember how RPN
361   math works. For all the others there is a little example below,
362   that shows how to do a little addition in RPN.}
364 \begin{frame}[fragile]{RPN basics: Step 0}
365 $15+23=38$
366 \begin{alltt}
367             1: NAN
368             2: NAN
369             3: NAN
370 \end{alltt}
371 \end{frame}
372 \begin{frame}[fragile]{RPN basics: Step 1}
373 $\mathbf{15}+23=38$
374 \begin{alltt}
375 [15]        1: \textbf{15}
376             2: NAN
377             3: NAN
378 \end{alltt}
379 \end{frame}
380 \begin{frame}[fragile]{RPN basics: Step 2}
381 $15+\mathbf{23}=38$
382 \begin{alltt}
383 [23]        1: \textbf{23}
384             2: 15
385             3: NAN
386 \end{alltt}
387 \end{frame}
388 \begin{frame}[fragile]{RPN basics: Step 3}
389 $15\mathbf{+}23=38$
390 \begin{alltt}
391 [+]         1: \textbf{38}
392             2: NAN
393             3: NAN
394 \end{alltt}
395 \end{frame}
397 \newpage 
399 \begin{frame}{math in the graph (+)}
400 \addgraph{RPN-simple}
401 \end{frame}
403 \mode<article>{A simple addition. We add a fixed value to a data
404   source. Note that at least one data source must appear inside a CDEF
405   expression. The input to a CDEF expression can come from another
406   CDEF expression.}
408 \begin{frame}{simple gradient}
409 \addgraph{RPN-grad-a}
410 \end{frame}
412 \begin{frame}{the MAX function}
413 \addgraph{RPN-max}
414 \end{frame}
416 \mode<article>{The MAX function operates on two values. In this example
417   the input comes from two different data sources.}
419 \begin{frame}{the LIMIT function}
420 \addgraph{RPN-limit}
421 \end{frame}
423 \mode<article>{The \texttt{LIMIT} function will return UNKNOWN as soon
424   as the input value is outside the given range. UNKNOWN data does not
425   get drawn.}
427 \begin{frame}{the TREND function}
428 \addgraph{RPN-trend}
429 \end{frame}
431 \mode<article>{If a data source varies massively, the TREND function
432   lets you smooth away by building a moving average. By calculating
433   the average, the output gets shifted by the length of the TREND
434   calculation.}
436 \begin{frame}{the TREND with early start}
437 \addgraph{RPN-trend-start}
438 \end{frame}
440 \mode<article>{In the previous graph there was a bit of data missing
441   at the left border of the graph. This was because rrdgraph loads
442   exactly the amount of data that is required in the graph (yes same
443   story as before). By loading more data, we can provide the TREND
444   function with enough input, so that it can calculate the first few
445   pixels as well.}
447 \begin{frame}{the TREND and SHIFT}
448 \addgraph{RPN-trend-shift}
449 \end{frame}
451 \mode<article>{Another interesting option is to SHIFT the result of
452   the TREND calculation back in time, so that it matches with the
453   source data. This allows us to see more easily when there are
454   'outliners'}
456 \mode<article>{\newpage}
459 \begin{frame}{the IF function}
460 \addgraph{RPN-if}
461 \end{frame}
463 \mode<article>{The IF function requires three items on the stack. It
464   turns \texttt{a,b,c,IF} into \texttt{if a then b else c}. There is a
465   bunch  of operators that go along with the \texttt{IF}: \texttt{LT}
466   less, \texttt{LE} - less or equal, \texttt{EQ} - equal, \texttt{NE}
467   not equal, \texttt{GE} - greater or equal, \texttt{GT} - greater.}
469 \begin{frame}{horizontal gradient}
470 \addgraph{RPN-grad-b}
471 \end{frame}
474 \begin{frame}{about invisibility}
475 \addgraph{RPN-UNKN}
476 \end{frame}
478 \mode<article>{Unknown values are not drawn on the graph. Here we
479   use trick to only show the largest values.}
482 \begin{frame}{positional drawing count}
483 \addgraph{RPN-count}
484 \end{frame}
486 \mode<article>{If you are into bar charts, you might fake them with
487   this trick. COUNT, counts the values of the data set. We use this,
488   together with the modulo operator to suppress the drawing of every
489   third entry.}
491 \begin{frame}{access the previous value}
492 \addgraph{RPN-prev}
493 \end{frame}
495 \begin{frame}{positional drawing time}
496 \addgraph{RPN-time}
497 \end{frame}
499 \newpage
500 \begin{frame}{positional drawing time-shifting}
501 \addgraph{RPN-time-minus}
502 \end{frame}
504 \mode<article>{There is also a function for accessing the Unix time
505   (seconds since 1970) associated with the graph data. With it, you
506   can make your stripes a fixed number of seconds wide.}
508 \begin{frame}{time and resolution issues}
509 \addgraph{RPN-time-odd}
510 \end{frame}
512 \mode<article>{\newpage}
514 \mode<article>{Whenever RRDtool graph has to do math with data sets
515   that come in different step sizes, it first to adjust the step sizes
516   so that they match. To do this, it finds the greatest common divisor
517   and uses it as the new step size.}
519 \begin{frame}[fragile]{CDEF internals}
520 \begin{itemize}[<+-| alert@+>]
521 \item data may come in different resolutions
522 \item all items in a CDEF must have the same resolution
523 \item resolution is expanded to greatest common devisor (gcd)
524 \item example: gcd(6,9) = 3, gcd(1,6) = 1
525 \end{itemize}
527 trick: an rrd with one a second step.
528 \begin{alltt}
529 rrdtool create one.rrd --step=1
530    DS:one:GAUGE:2:U:U
531    RRA:AVERAGE:0.5:1:1
532 \end{alltt}
533 \end{frame}
535 \begin{frame}{step=1 trick: high resolution cdef}
536 \addgraph{RPN-time-odd-hires}
537 \end{frame}
539 \mode<article>{By introducing this special rrd with a ``one second
540   step'' the greatest common divisor (gcd) becomes one.}
542 \section{Consolidation functions}
544 \begin{frame}{finding the average}
545 \addgraph{VDEF-average}
546 \end{frame}
548 \begin{frame}{calculating min and max}
549 \addgraph{VDEF-minmax}
550 \end{frame}
553 \mode<article>{\newpage}
555 \begin{frame}[fragile]{min max code example}
556 \begin{alltt}
557 LINE:a#456:a
558 VDEF:max=a,MAXIMUM
559 LINE:max#123
560 VRULE:max#123:maximum
561 GPRINT:max:%.1lf
562 GPRINT:max:%H\(\backslash\):%M\textbf{:strftime}
563 \end{alltt}
564 A VDEF result has a value and a time assigned.
565 \end{frame}
567 \begin{frame}{Least Squares Line (y=x*m+b)}
568 \addgraph{VDEF-lsl}
569 \end{frame}
571 \mode<article>{\newpage}
572 \section{Holt Winters Aberrant Behaviour Detection}
574 \begin{frame}{about alert generation}
575 \begin{itemize}[<+-| alert@+>]
576 \item when something unexpected happens send an alert
577 \item fixed thresholds are too wide a net
578 \item moving averages weigh all data equal
579 \item holt winters can predict the future
580 \item and no one considers himself clever enough to use it
581 \end{itemize}
582 \end{frame}
584 \begin{frame}{rrd - holt winters assumptions}
585 \begin{itemize}[<+-| alert@+>]
586 \item data is periodic in nature
587 \item data has continuity 
588 \item data continuity is periodic
589 \item recent data is more important
590 \end{itemize}
591 \end{frame}
593 \begin{frame}{holt winters aberrant behavior}
594 \begin{itemize}[<+-| alert@+>]
595 \item prediction of future value and confidence band
596 \item confidence band is like a standard deviation
597 \item real value compared to predicted value +/- confidence band
598 \end{itemize}
599 \end{frame}
601 \mode<article>{With holt winters RRDtool will calculate a prediction
602   and a confidence band (think of it as a standard deviation) for the
603   current value. It will then compare the prediction with the
604   actual value. If the actual value falls outside the confidence band
605   of the predicted value (or some multiple of it), then a confidence
606   band violation is registered. If multiple violations are registered
607   within a configurable interval, RRDtool logs a failure.}
609 \begin{frame}<presentation>{holt winters configuration}
610 \begin{itemize}[<+-| alert@+>]
611 \item HWPREDICT for starters
612 \item tweaking required
613 \item know the knobs to turn
614 \item use real data to test
615 \item FAILURES very short
616 \item \texttt{rrdtool tune} and \texttt{resize}
617 \end{itemize}
618 \end{frame}
620 \mode<article>{
621 \begin{itemize}[<+-| alert@+>]
622 \item Keep it simple, go for HWPREDICT only when you start using
623   holt winters in RRDtool.
624 \item Every data set is different, tweaking is required. 
625 \item Know which knobs to turn.
626 \item Use real data when experimenting.
627 \item Use \texttt{rrdtool tune} and \texttt{rrdtool resize} to tweak settings.
628 \item The FAILURES RRA is short!
629 \end{itemize}
632 \begin{frame}{holt winters parameters}
633 \texttt{RRA:HWPREDICT:}\emph{rows}\texttt{:}\emph{alpha}\texttt{:}\emph{beta}\texttt{:}\emph{period}
635 \begin{description}
636 \item[\emph{alpha}:] adaption rate of the baseline (1 fast, 0 slow)
637 \item[\emph{beta}:] adaption rate of the slope (1 fast, 0 slow)
638 \item[\emph{period}:] how many steps in a period (use 1 to  disable)
639 \item[\emph{gamma}:] seasonal adaption rate of the baseline\\(alpha by
640   default)
641 \item[\emph{dev\_gamma}:] seasonal adaption rate of the confidence
642   band\\
643  (gamma by default)
644 \end{description}
646 the gamma and confidence band are tunable with \texttt{rrdtool tune}
647 \end{frame}
649 \mode<article>{
650 Reading \href{http://cricket.sourceforge.net/aberrant/lisa2000_paper.pdf}{Brutlag's original paper}
651 I wrote down the formulas he uses for calculating holt winters. This
652 helped me quite a lot in understanding the relationships between
653 alpha, beta, gamma and delta.}
655 \begin{frame}[fragile]{the rrdtool holt winters formula}
656 \begin{small}
657 \begin{alltt}
658 a - baseline (RRA CDP Parameter)
659 b - slope (RRA CDP Parameter)
660 c - seasonal (SEASONAL RRA)
661 d - deviation (DEVSEASONAL RRA)
662 pred - predicted value
663 real - real value\pause
665 pred\{next\} = a\{now\} + b\{now\} + c\{next_prev_period\}\pause
667 a\{now\} = alpha * (real\{now\} - c\{now_prev_period\}) 
668          + (1-alpha) * ( a\{prev\} + b\{prev\})\pause
669 b\{now\} = beta  * (a\{now\} - a\{prev\}) 
670          + (1-beta) * b_prev\pause
671 c\{now\} = gamma * (real\{now\} - a\{now\}) 
672          + (1-gamma) * c\{now_prev_period\}\pause
673 d\{now\} = dev_gamma * abs(real\{now\} - pred\{now\}) 
674          + (1-dev_gamma) * d\{now_prev_period\}\pause
676 \end{alltt}
677 \end{small}
678 \end{frame}
680 % must be formatted like that
681 % to break gobbling mode!
682 %\mode
683 %<all>
685 \begin{frame}{hw demo: the test data}
686 \addgraph{HW-input}
688 traffic at a peering point
689 \end{frame}
691 \begin{frame}[fragile]{drawing a hw graph}
692 \begin{lstlisting}[language=xml]
693 DEF:in=hw.rrd:in:AVERAGE
694 DEF:pred=hw.rrd:in:HWPREDICT
695 DEF:conf=hw.rrd:in:DEVPREDICT
696 DEF:fail=hw.rrd:in:FAILURES
697 TICK:fail#ff8:1:Failures
698 CDEF:lowconf=pred,conf,2,*,-
699 LINE1:lowconf
700 CDEF:confwidth=conf,4,*
701 AREA:confwidth#cfc:Band:STACK
702 LINE0.1:0#3a1::STACK
703 LINE0.1:lowconf#3a1
704 LINE1:in#c00:InOctets
705 LINE1:pred#0a0:Prediction
706 \end{lstlisting}
707 \end{frame}  
709 \mode<article>{For starters we set the period to 1. This disables HW's
710   ability to adjust to periodic behavior in the data but it lets us
711   better observe the effects of the different parameter settings since
712   the adjustment period is much shorter.}
714 \begin{frame}{hw demo: alpha}
715 \addgraph{HW-p1-a0_5-b0_001}\\
716 \addgraph{HW-p1-a0_1-b0_001}
717 \end{frame}
719 \mode<article>{The smaller the alpha the slower the adaption. As the
720   prediction is now generally off by quite a bit, this causes the
721   confidence band to grow as well.}
723 \mode<article>{\newpage}
725 \begin{frame}{hw demo: beta}
726 \addgraph{HW-p1-a0_1-b0_001}\\
727 \addgraph{HW-p1-a0_1-b0_1}
728 \end{frame}
730 \mode<article>{The larger the beta the `heavier' the prediction
731   becomes.}
733 \begin{frame}{hw demo: period}
734 \addgraph{HW-p1-a0_5-b0_001}\\
735 \addgraph{HW-p48-a0_5-b0_001}
736 \end{frame}
738 \begin{frame}{hw demo: tuning}
739 \addgraph{HW-p48-a0_5-b0_001}\\
740 \addgraph{HW-p48-a0_2-b0_001}
741 \end{frame}
743 \begin{frame}{hw demo: tuning II}
744 \addgraph{HW-p48-a0_2-b0_001}\\
745 \addgraph{HW-p48-a0_03-b0_001}
746 \end{frame}
748 \begin{frame}{hw demo: tuning III}
749 \addgraph{HW-p48-a0_03-b0_001}\\
750 \addgraph{HW-p48-a0_03-b0_1}
751 \end{frame}
753 \newpage
755 \section{The *v Interfaces}
757 \begin{frame}{graphv script}
758 \lstinputlisting{ex/v-interfaces.pl}
759 \end{frame}
761 \begin{frame}{graphv output}
762 \lstinputlisting{ex/v-interfaces.txt}
763 \end{frame}
765 \mode<article>{The image key only shows up when the graph file name is '-'.}
767 \begin{frame}{v-interfaces}
768 \begin{itemize}[<+-| alert@+>]
769 \item rrdtool info
770 \item rrdtool update\textbf{v}
771 \item rrdtool graph\textbf{v}
772 \end{itemize}
773 \end{frame}
775 \mode<article>{Using the output of updatev is much more efficient than
776 re-reading the rrd file after running normal update against them.}
778 \section{RRD Caching Daemon}
780 \begin{frame}{rrdcached --- pushing rrd performance}
781 \begin{itemize}[<+-| alert@+>]
782 \item i/o comes in 4k chunks
783 \item normal update is $\sim{}100$ bytes
784 \item grouping updates = performance for free
785 \item data in memory
786 \item journaling disaster recovery
787 \item simple integration using enviroment variables
788 \item communication via unix socket or ip
789 \item limited security for remote operation
790 \item no updatev support yet
791 \item available with 1.4
792 \end{itemize}
793 created by Florian Forster and Kevin Brintnall
794 \end{frame}
796 \section{Future}
798 \begin{frame}{Future RRDtool Features}
799 \begin{itemize}[<+-| alert@+>]
800 \item full remote support for rrdtool operations
801 \item getopt to popt migration for thread-safety
802 \item portable data format
803 \item in-memory updates for cached to support updatev
804 \item rrd internal journal for i/o optimization
805 \item separation of database and charting features
806 \item json interface and javascript charting frontend
807 \end{itemize}
809 \pause
810 Or anything else someone is willing\\
811 to provide time or money for.
812 \end{frame}
815 \section{Examples}
817 \begin{frame}{The size of an rrd - code}
818 \lstinputlisting{ex/rrd-size.pl}
819 \end{frame}
821 \begin{frame}{the size of an rrd - result}
822 \lstinputlisting{ex/rrd-size.txt}
823 \begin{itemize}[<+-| alert@+>]
824 \item overhead is minimal
825 \item 8 byte per double 
826 \item \ldots per datasource
827 \item \ldots per RRA
828 \item \ldots per RRA row
829 \end{itemize}
830 \end{frame}
832 \mode<article>{The rrd format is highly efficient at storing non
833   sparse data. The overhead for an extra RRA or DS is normally a few
834   bytes on top of the 8 byte per double.}
837 \newpage  
838 \section{Real Live Example}
840 \mode<article>{The following example shows how to create a simple
841   traffic grapher with a shell script for data acquisition, and an
842   rrdcgi script to draw the graphs.}
844 \begin{frame}
845 \includegraphics[width=\textwidth]{traffic/codewalk}
846 \end{frame}
848 \begin{frame}[allowframebreaks]{data acquisition}
849 \lstinputlisting[language=bash]{traffic/ifbyteget.sh}
850 \end{frame}
852 \mode<article>{This little bash script polls the network traffic
853   counter from the linux proc tree and reformats it so that it can be
854   fed to rrdtool.}
856 \begin{frame}[allowframebreaks]{rrdcgi: scripting for the poor}
857 \lstinputlisting[language=xml]{traffic/index.cgi}
858 \end{frame}
860 \begin{frame}[allowframebreaks]{rrdcgi: include file function}
861 \lstinputlisting[language=xml]{traffic/graph.inc}
862 \end{frame}
864 \mode<article>{RRDtool's rrdcgi is a very simple scripting engine, that can pick
865   up pseudo xml elements from an html file and execute the
866   coresponding rrdtool commands. In this example we use environment
867   variables and an include file to save us from typing in the same
868   graph definition over and over again.}
870 \mode<presentation>{
871 \begin{frame}
872 \begin{center}
873 \Huge ?
874 \end{center}
875 \end{frame}
876 \begin{frame}
877 \begin{center}
878 Tobi Oetiker <tobi@oetiker.ch>
879 \end{center}
880 \end{frame}
883 \mode<article>{
884 \vspace{\stretch{1}}
885 Tobias Oetiker <tobi@oetiker.ch>
887 \end{document}
888 %%% Local Variables:
889 %%% TeX-master: "presentation.tex"
890 %%% mode: flyspell
891 %%% TeX-PDF-mode: t
892 %%% End: