How to get a CGI script working on Yun Rev2

Hadn't thought of that but generating on demand is not a bad idea at all, why produce a graph if nobody is looking at it. On the other hand the RRD database also resides on the SD card and it has to be updated although its size never changes and only certain sectors would be modified at a given time and only once when created and once when updated, except perhaps the file date time stamp that would be updated all the time.

You got me thinking about another problem I have, I was writing to some temporary files on the SD card to manipulate the data and get it into the RRD database. If the power is lost while the file is still open I had setup special code to reboot the Yun to close out the files. Perhaps I should be using the RAM disk /tmp instead. This would avoid constantly writing to the SD card as well and if power is lost in the middle of a write, the files are purged anyway.

I think the path I'm going to take is to use;
http://javascriptrrd.sourceforge.net/
I tried it once before and it can be slow to load but the newer SD card I got for the Yun2 seems to be a little faster, it seems to want to load the entire RRD file, not just a range you would want to look at, the range is selected after the file is loaded by clicking on the scaler graph.