[mrtg] mrtg performance for multiple CPU hosts

Steve Shipway s.shipway at auckland.ac.nz
Thu Jan 28 21:35:49 CET 2010


> I'm in the process of migrating MRTG to a new server that has 4x CPUs.
> We use MRTG in a traditional setup -- no rrdtool.  We archive the MRTG
> output daily to reference later if questions arrive about historical
> performance, so it's nice to have the pictures generated
> automatically.
> 
> Problem: there doesn't seem to be a way to scale MRTG for multiple
> CPUs.  "fork", which would seem the logical way, only speeds up the
> SNMP queries, not rateup.  I've written some scripts to distribute the
> various hosts among a bunch of MRTG configs that I can then call in
> parallel, but this is sub-optimal and crude.  In particular, it would
> be nice to be able to tune the number of simultaneous threads for SNMP
> queries independently of the number of simultaneous rateups.

If you're interested in performance, then use RRD mode rather than Native (rateup) mode.  The overhead of rateup is considerable, you can get a 10x or more performance gain by changing to MRTG/RRD with a frontend (routers2, 14all, or mrtg-rrd).

If you archive daily images for later reference, you can still do this if you have MRTG/RRD with Routers2 (this will allow daily RRD or Image archiving, RRD archiving is better as you can still extract the raw CSV data).

The 'Fork' option works best under UNIX (Windows has some problems with it I believe).  This makes multiple worker threads and is the best way to go when you have more memory and CPU available; under RRD mode you'll get multiple simultaneous updates, and if using RRD 1.3.x or 1.4.x with MRTG in daemon mode, you'll also benefit from the cached block updates in RRD giving even more performance.

I'll add a quick plug for the book http://www.steveshipway.org/book/ which has a chapter about performance tuning and configuration that answers your problem in detail.

Steve



More information about the mrtg mailing list