Increase size of rrd4j database? Practical limits?

Hi,

I know that rrd4j is a round-robin database, that delets old entries. And as far as I understand, the maximum age of any given entry will be 10 years in the default configuration and the time interval between individual data-point will grow bigger the older the data gets.

But when looking into the files, the size per item is only a mere few hundred kB.
So could one actually increase the size, like maximum age up to 30 years for example and or increase the time it takes until the resolution of data will be reduced?

what are the pracitcal limits? CPU?

Yes, you can configure rrd4j by yourself in all aspects. The default values are sufficient from openHAB perspective. If you want to have much more time span and/or details, there might be better options like InfluxDB and jdbc (i.e. SQL DB like MariaDB or Postgre SQL).
Afaik the granularity was chosen to get a small footprint within the file system, there might be users with thousands of items, and each item will be persisted, by default, with 738 KByte per Number Item, you can easily use a GByte of disk space…

But these days, even a RaspberryPi can have TeraBytes of storage with ease. So even with thousands of items, there shouldnt be any noticable impact on storage at all.

Thats the reason I wanted to know, what happens with rrd4j when you increase the resolution, will just work fine even with a thousand-fold file-size for example? Or will the performance degrade with bigger files?

I like the concept of RRD4J generally I just would like to have a little more resolution (so instead of ten steps average hundred steps average for example).

does anyone know what the implications are?

That is a bit of an over simplification. What it does is as the data ages it decimates the data by replacing ten entries with the average of those ten entries. I just want to avoid confusion on how it works for future readers.

The default configuration has five archives per Item. From the docs:

granularity of 10s for the last hour
granularity of 1m for the last week
granularity of 15m for the last year
granularity of 1h for the last 5 years
granularity of 1d for the last 10 years

That’s pretty good granularity for most purposes especially given that rrd4j isn’t well supported by external data analysis tools so the data is pretty much only going to be useful for generating OH charts and accessing historic data in rules. If you need more than that an external database will serve you better.

But if you want to change it you can. The add-on docs explain how to change the defaults as well as how to configure it on an Item by Item basis.

But not by default and that’s not the case for the average user. Also in a default openHABian config, rrd4j needs to fit into ZRAM which is very tiny by comparison.

Larger files, potentially slower response times when retrieving old data, bigger bursts of activity when the DB gets compressed since it’s doing more work less frequently when it compresses.

If the default config doesn’t work for you please do configure it as you desire. Everything you need to know is in the add-on docs and I recently helped someone with a config here which might be informative. And do come back if you run into trouble and we might be able to help.

2 Likes