[mrtg] Re: Reading config files -- FAST

Rainer Bawidamann Rainer.Bawidamann at rz.uni-ulm.de
Tue Sep 12 17:58:16 MEST 2000

In article <20000912135921.H297 at nextra.com>,
	bn at nextra.com (Bjorn Nordbo) writes:
> however this routine misses line continuation:

What about not using line continuation? It's your config file!
(of course that might give you very long lines)

> As far as I can see, I have three options:
> 1. Continue to search for a faster way to read configs

Hard to do in perl. Might be faster in C. There is a module "Inline"
which could help.

> 2. Extract every target config to another medium than one big, flat file
>    and write a config backend to read that for the display scripts.
> 3. As for (2), but use this backend for MRTG (2.9) too.

aka 'config cache':

a. You could store the complete perl structures with Storable.pm (or
   Data::Dumper but Storable is much faster).
b. Change mrtg/MRTG_lib so every access to configuration is done thru a
   function/method. These functions can get the config from a dbm file
   or sql database ... (or tie - but the config structures are not
   simple hashes but hashes of hashes of ...)

I implemented a) in 14all 1.0 to test it. It doesn't give any difference
for me but my (test) config files are small. If anybody with big config
files tries it please tell me if it gives you some speed.

A little speedup might due to some parser changes in 14all 1.0
(hopefully I didn't break anything).

The actual 14all 1.0 is v1.0p18, you can get it from the web site as

(14all 1.1 uses the parser from MRTG_lib so no change there).

Rainer.Bawidamann at rz.uni-ulm.de

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the mrtg mailing list