[rrd-users] Re: RRD-Performance Issue - Need Help

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Jun 20 12:23:28 MEST 2006


On Tue, Jun 20, 2006 at 11:57:59AM +0200, Simone Felici wrote:

> 6. determinate InCounter32 (cat in.txt | grep line | awk blablabla)
> 7. determinate OutCounter32 (cat out.txt | grep line | awk blablabla)

Ever heard of the useless use of cat award ?


You could probably save some cycles by changing:

>>>   cat in.txt | grep whatever | awk '{print $2}'

remove cat:

>>>   < in.txt grep whatever | awk '{print $2}'

(that '<' really needs to be there)


and remove grep as well:

>>>   < in.txt awk '/whatever/{print $2}'


This means you don't have to start two out of three programs a
lot of times.

> Any suggesions on how improve performance or any other solution?

After changing your script like I suggested, you should search for
similar improvements.  Don't fire up unnecessary programs.  This
may include 5999 out of 6000 times starting awk.

For instance: why start awk twice to look for ifInOctets32 and
ifOutOctets32.  You may be able to process the output of snmpwalk in
one run.  There's no point in splitting inbound and outbound unless
you really need to, is there?


-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/

--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list