[mrtg-developers] Re: proposed mrtg performance improvements?

Tobias Oetiker oetiker at ee.ethz.ch
Fri Nov 21 07:43:59 MET 2003


Yesterday Dave Plonka wrote:

Hi Dave,

>
>   for (;;) { # ever
>     readtargets();       # get the current state of the routers, uses Forks...
>     foreach $target (@targets) {
> 	getcurrent();    # get the current values for the target
> 	writegraphics(); # update the RRD file for that target
>     }
>   }
>
> And the "getcurrent" part is not parallelized currently.


Yes, but the snmpgets only happen in readtargets, getcurrent is
just data mangling ... there is no latency as fahr as I remember my
code ...

> I guess I just wanted to know if I'm missing some subtle detail about
> why perhaps the getcurrent/writegraphics shouldn't be similarly
> performed in parallel by the forked children.

because this activity is disk and cpu bound, parallelisation can
help you with cpu bound as you have a smp system, but so can severl
cfg files ... diskio will not get better when more process
"threads" pound on it ...

> Since there are these short waits for network i/o (between the getcurrent
> SNMP gets and response) it seems that's the opportunity to interleave
> some of the disk i/o.

the snmp stuff happens in readtargets ...

> > Have you used the perl profiler on the code, this might reveal
> > where the hotspots are in the code ...
>
> No, I might try that.

when I did this last time I discovered a very bad performance
killer in the cfg reading code ... It cut the startup time by a
huge factor witch grew progressively with the size of the config
file ...

> Anotehr thing I'm wondering about is trying to avoid the often
> unnecessary RRDs::tune and "threscheck" calls.  Perhaps the mrtg
> process could remember the previous tune that it performed so as
> not to do it repeated in RunAsDaemon mode.

this might be a a sensible thing to do yes ... actually it does
not have to remember it at all, because the config will not change
after startup, so a single tune run is perfectly sufficient ...

cheers
tobi

-- 
 ______    __   _
/_  __/_  / /  (_) Oetiker @ ISG.EE, ETZ J97, ETH, CH-8092 Zurich
 / // _ \/ _ \/ /  System Manager, Time Lord, Coder, Designer, Coach
/_/ \.__/_.__/_/   http://people.ee.ethz.ch/~oetiker   +41(0)1-632-5286

--
Unsubscribe mailto:mrtg-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg-developers



More information about the mrtg-developers mailing list