<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Webdings;
        panose-1:5 3 1 2 1 5 9 6 7 3;}
@font-face
        {font-family:"Arial Narrow";
        panose-1:2 11 6 6 2 2 2 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Here&#8217;s some more info on the RRDcached options.&nbsp; Also see <a href="http://oss.oetiker.ch/rrdtool/doc/rrdcached.en.html">http://oss.oetiker.ch/rrdtool/doc/rrdcached.en.html</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Say you use these options: &nbsp;&nbsp;&nbsp;&nbsp;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>-t 4 &#8211;w 1800 &#8211;z 60 &#8211;f 3600<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>This means that updates for an RRD will be written to the disk every 1800+rand(60) seconds, IE every 30 minutes plus up to 1 minute.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The reason for the &#8211;z option is to help spread the IO out over a period, preventing it from hitting hard all at the same time.&nbsp; This helps prevent buffer-overrun where Linux freezes as it flushes the IO buffer.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The &#8211;f options specifies an additional flush frequency for &#8216;orphaned&#8217; RRD files.&nbsp; The flush is normally only checked when the RRD is updated, so if you stop updating, then pending updates may end up stuck in the cache.&nbsp; This makes rrdcached scan every hour for orphaned updates, and flush them to disk.&nbsp; You should have the &#8211;f option larger (maybe twice the size) than the &#8211;w option.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>You can make the &#8211;z option larger if &#8211;w is larger.&nbsp; So, in our case with a 30min cache timeout, we could increase &#8211;z up to maybe 15min (-z 900) if the disk IO is getting too high at times and low at others.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The more risk you want to take, the larger you can make &#8211;w (this increases caching time and therefore decreases disk IO).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The setenv RRDCACHED_ADDRESS option for Apache works for us (haven&#8217;t tried with 14all but other non-rrdcached-aware CGI scripts are OK), though you need to set it to the correct value and have it in the correct place.&nbsp; <b>I hope you didn&#8217;t just copy my example</b> &#8211; your cgi-bin is almost certainly in a different location and your socket in a different path!&nbsp; Also make sure that the apache user can read and write to the rrdcached socket!&nbsp; Finally, make sure that you have the 1.4 version of the RRDs perl libraries as well as the 1.4 version of the rrdtool executable (sometimes people have multiple versions of rrdtool perl libraries installed indifferent locations).&nbsp; Mike&#8217;s modification to 14all sets the environment var in the code, basically doing what the SetEnv directive in the httpd.conf should be doing.&nbsp; <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Steve<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><hr size=2 width="100%" align=center></span></div><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Steve Shipway<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>ITS Unix Services Design Lead<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>University of Auckland, New Zealand<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Floor 1, 58 Symonds Street, Auckland<o:p></o:p></span></p><p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#595959'>Phone: +64 (0)9 3737599 ext 86487<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#595959'>DDI: +64 (0)9 924 6487<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#595959'>Mobile: +64 (0)21 753 189<o:p></o:p></span></i></p><p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#595959'>Email: <a href="mailto:s.shipway@auckland.ac.nz"><span style='color:#595959'>s.shipway@auckland.ac.nz</span></a><o:p></o:p></span></i></p><p class=MsoNormal><span lang=EN-GB style='font-size:18.0pt;font-family:Webdings;color:green'>P</span><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:blue'> </span><span lang=EN-GB style='font-size:10.0pt;font-family:"Arial Narrow","sans-serif";color:green'>Please consider the environment before printing this e-mail</span><span lang=EN-GB style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:blue'> </span><span lang=EN-GB style='font-size:7.5pt;font-family:"Verdana","sans-serif";color:navy'><o:p></o:p></span></p><p class=MsoNormal><i><span style='font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></i></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p>&nbsp;</o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Pavel Ruzicka [mailto:pavouk@pavouk.org] <br><b>Sent:</b> Wednesday, 1 August 2012 9:19 p.m.<br><b>To:</b> Steve Shipway<br><b>Cc:</b> mrtg@lists.oetiker.ch<br><b>Subject:</b> Re: [mrtg] MRTG with RRDcached tuning<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p style='margin:0cm;margin-bottom:.0001pt'><span style='font-size:9.0pt;font-family:"Courier New"'>Hello,<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; -s mrtg -m 0660 -l unix:/var/tmp/rrdcached.sock -l mrtg.auckland.ac.nz<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; -l localhost -z 60<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; <o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; -p /var/tmp/rrdcached.pid -t 4 -j /u01/rrdtool/journal -b /u01/rrdtool<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; -w 1800 -O -a 6<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>I tried -w 1800 and -z 60, but it still doesn't solve massive pdflush.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>I don't understand exactly -z option. I understand from documentation<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>that when I set -z to 60 seconds, that it set random write delay between 0 and 60 seconds. When I have -w for 1800, that rrdcached writes files to disk in 60 seconds and -w option is not used. Is it true?<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; This has had a significant improvement on our previous IO problems.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; For the frontend, you could use Routers2 (which supports rrdcached directly<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>I can't change easily frontend for historical reasons :-)<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; :). However, if you prefer to use 14all, then you can still do this via<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; <o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; rrrdcached, at least if you are using Apache. Just set the<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; RRDCACHED_ADDRESS environment variable appropriately in the web server so<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; that it is set when the CGI is called, and this will make the 14all calls<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; all use rrdcached, where possible.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; &lt;Directory &quot;/u01/www/cgi-bin&quot;&gt;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; <o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; SetEnv RRDCACHED_ADDRESS unix:/var/tmp/rrdcached.sock<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; <o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; &lt;/Directory&gt;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>I tried it, but it probably doesn't use rrdcached. How can I check it?<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>I have on graphs white space on the side. It looks like 14all.cgi use not updated rrd file.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; You might want to consider using the trunk version of rrdtool, since this<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&gt; has more comprehensive rrdcached support for the various rrdtool functions.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>I prefer to use stable version, if it works.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>Thank you very much for answers.<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>Best regards,<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-block-indent:0;-qt-user-state:0'><span style='font-size:9.0pt;font-family:"Courier New"'>Pavel<o:p></o:p></span></p><p style='margin:0cm;margin-bottom:.0001pt;-qt-paragraph-type:empty;-qt-block-indent:0'><span style='font-size:9.0pt;font-family:"Courier New"'>&nbsp;<o:p></o:p></span></p></div></div></body></html>