<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: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:11.0pt;
        font-family:"Calibri","sans-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.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
 /* List Definitions */
 @list l0
        {mso-list-id:734855438;
        mso-list-type:hybrid;
        mso-list-template-ids:-79908856 336134159 336134169 336134171 336134159 336134169 336134171 336134159 336134169 336134171;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l1
        {mso-list-id:1611275509;
        mso-list-type:hybrid;
        mso-list-template-ids:-595166012 336134161 336134169 336134171 336134159 336134169 336134171 336134159 336134169 336134171;}
@list l1:level1
        {mso-level-text:"%1\)";
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</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>Has anyone on the list any thoughts on the MRTG check
scheduler?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Currently (we&#8217;re considering Daemon mode only, here),
every 5 mins it will run ALL the Target checks sequentially, running multiple
threads according to the Forks: directive. &nbsp;After all checks are finished,
it will sleep until the next 5-min cycle starts.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>This is sub-optimal because<o:p></o:p></p>

<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>1)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>You get a huge burst of CPU usage followed by a period
of silence, which can make the frontend go slow and messes up monitoring of the
system&#8217;s own CPU<o:p></o:p></p>

<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l1 level1 lfo1'><![if !supportLists]><span
style='mso-list:Ignore'>2)<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>If the checks exceed the 5min window, then you miss a
polling cycle and need to manually tune your forks upwards.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>I would propose an alternative method of scheduling.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span
style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>Rather than specifying a number of forks, make it a
MAXIMUM number (a bit like when defining threads in apache)<o:p></o:p></p>

<p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo2'><![if !supportLists]><span
style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span></span><![endif]>After the initial read of the CFG files, MRTG knows how
many Targets there are. Divide the Interval by this to get the
interleave.&nbsp; Then, start a new check every interleave, starting a new
thread if necessary and if we&#8217;ve not hit the maximum threads.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Benefits would be that it can expand to handle more targets,
and spreads the load over the window.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Disadvantages would be that it is hard to tell when you&#8217;re
reaching capacity, and (more importantly) it might be hard to do the
optimisation that MRTG does where a single device is queried once for all
interfaces.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>We coded up basically this system here, however it didn&#8217;t
use MRTG in daemon mode which negates a lot of the benefits you can gain from
daemon mode and the new RRD memory-mapped IO.&nbsp; I&#8217;ve not yet looked
at coding it directly into the MRTG code.<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Anyone have any thoughts?<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>Steve<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div class=MsoNormal align=center style='text-align:center'><span lang=EN-US>

<hr size=2 width="100%" align=center>

</span></div>

<p class=MsoNormal><b>Steve Shipway<o:p></o:p></b></p>

<p class=MsoNormal><span style='font-size:10.0pt'>steve@steveshipway.org<o:p></o:p></span></p>

<p class=MsoNormal><i><span style='font-size:10.0pt;color:#595959'>Routers2.cgi
web frontend for MRTG/RRD; NagEventLog Nagios agent for Windows Event Log
monitoring; check_vmware plugin for VMWare monitoring in Nagios and MRTG; and
other Open Source projects.<o:p></o:p></span></i></p>

<p class=MsoNormal><span style='font-size:10.0pt'>Web: <a
href="http://www.steveshipway.org/software">http://www.steveshipway.org/software</a><o:p></o:p></span></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='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='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><span style='font-size:10.0pt'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>