2018-10-12
Serious slowness with rrdgraph from rrdtool 2 years ago
One of the things still needing migrating is the NTP server stats which obviously uses rrdtool. Because I want to keep the history I migrated the datasets with:/usr/local/rrdtool/bin/rrdtool dump ntpvals-stardate.cs.uu.nl.rrd \ | ssh newhost /usr/bin/rrdtool restore -f - ntpvals-stardate.cs.uu.nl.rrdAnd then create a graph of the plloffset for example using:/usr/bin/rrdtool graph /tmp/plloffset-stardate.cs.uu.nl-24hours.png \ --title "stardate.cs.uu.nl pll offset (last 24 hours)" --imginfo \ '<img src="tmpgraphs/%s" WIDTH="%lu" HEIGHT="%lu" alt="Graph">' \ --start -24hours --end now --vertical-label="Seconds" --color BACK#0000FF \ --color CANVAS#c0e5ff --color FONT#ffffff --color GRID#ffffff \ --color MGRID#ffffff --alt-autoscale --imgformat PNG --lazy \ DEF:offset=ntpvals-stardate.cs.uu.nl.rrd:plloffset:AVERAGE \ CDEF:wipeout=offset,UN,INF,UNKN,IF CDEF:wipeoutn=wipeout,-1,* \ LINE1:offset#000000:"Offset\:" \ GPRINT:offset:LAST:"Current\:%.3lf%s" \ GPRINT:offset:MIN:"Min\:%.3lf%S" \ GPRINT:offset:MAX:"Max\:%.3lf%S" \ GPRINT:offset:AVERAGE:"Average\:%.3lf%S" \ AREA:wipeout#e0e0e0 AREA:wipeoutn#e0e0e0But on the old server this takes 0.026 seconds, on the new server 3 minutes and 47.46 seconds. No idea what is happening, strace shows nothing strange and rrdtool uses 1 cpu at 100% all that time. Update 2018-10-13: Searching through the options in use found that the difference between 0.039 seconds and 3 minutes 56.473 seconds is the --alt-autoscale parameter. Enabling it makes rrdgraph very slow.