[rrd-users] RRA's for a Month

Simon Hobson linux at thehobsons.co.uk
Sat Nov 6 07:53:09 CET 2010

Shaun Reitan wrote:
>For historical reasons and trying to be as efficient as possible i plan
>to create separate RRD databases per month.  This will allow me to keep
>a customers data for as long as the customer exists.  We generally don't
>generate graphs for longer than 1 month (normally 1 Hour, 24 Hour, 7
>Day, 1 Month) graphs.  However there's a possibility that i may want to
>generate a graph longer than 1 month.  I'm thinking this wont be a
>problem because i can just tell rrdgraph to combine each rrd to generate
>the length i need ( chances of me needing to do this is slim ).

And it's a PITA to do. It's not hard, but RRD Tools doesn't have any 
automated way to do it and you have to code your own :
if t>T then y=Y1 else y=Y2
where T is the switch date/time between data sets, Y1 and Y2 are the 
two data sets, and t and y are the graph values.

Of course, if you want 3 sets then it gets more work, and so on. This 
means you'll spend a lot of time creating graphing scripts for 
different length graphs.

>I do however want to possibly generate graphs for the last 30 days 
>of data which if I'm into the middle of a month would mean that i 
>would need to span two RRD files.  Does anybody for see any problems 
>with this?

Actually, you will ALWAYS have whatever length of data you keep in 
one file - if you do it sensibly. You are thinking you'll create a 
new, empty, RRD file at the start of each month. How about you keep 
updating a single file, and archive it at the end of each month ? 
Your current file will always have the last 31 days (or whatever) in 
it and so you can graph the last 30 days without any problems.

As above, once you have your data split, graphing becomes a lot harder.

Could you get by by keeping a lower resolution data set for a year or 
two ? An even lower res for longer ?

While it's a lot more work, could you keep one active RRD (with 
historical data for say a year), and then dump/munge/import the data 
you want to archive in some month end scripting ?

Simon Hobson

Visit http://www.magpiesnestpublishing.co.uk/ for books by acclaimed
author Gladys Hobson. Novels - poetry - short stories - ideal as
Christmas stocking fillers. Some available as e-books.

More information about the rrd-users mailing list