[rrd4j] Different storage size on same configuration?

I’m using rrd4j for my loggings and have setup the rrd4j.cfg for my needs like:

PreisLogger.def=GAUGE,90,0,3,60
PreisLogger.archives=MAX,.5,1,1440:MAX,.5,5,2016:MAX,.5,15,2668
PreisLogger.items=E10_1,E10_2,E10_3,E5_1,E5_2,E5_3,Diesel_1,Diesel_2,Diesel_3,Temperature,Light_TH_Temperature,Light_TH_Humidity

I would have expected all .rrd files to be of the same size, however the first 9 (E10_1 to Diesel_3) have a size of 49412 while the other are 28280.

When checking with REST API the datapoints for the last 24 houres I get 1440 datapoints (as expected from the archive 1 setting), for the one with a smaller filesize I get only 360 datapoints. That would be a datapoint for every 4 minutes only.

Using DEBUG logging I see that values with bigger filesizes get 2 entries every minute like:

21:08:02.516 [DEBUG] [rsistence.rrd4j.internal.RRD4jService] - Stored 'E10_1' with state '1.2889999999999999236166559057892300188541412353515625' in rrd4j database (again)
21:08:02.722 [DEBUG] [rsistence.rrd4j.internal.RRD4jService] - Stored 'E10_1' with state '1.289' in rrd4j database

while the other only get:

21:09:03.634 [DEBUG] [rsistence.rrd4j.internal.RRD4jService] - Stored 'Light_TH_Temperature' with state '19.7' in rrd4j database

Checking a chart for an item with the smaller filesize I see that a changed value is kept for at least 4 minutes, although the chart (n3-line chart in habpanel) seems to have points for every minute.

I did figure a problem with my .cfg, which was initially build for fuel-prices (E10_1,…). The max and min value are set to 0 and 3. The later logged temperatures and humidities are logging values beyond those. Would that be the reason for the different filesize? The observations of @binderth in here do not go into that direction.

I’m just curious and want to understand!

Did some more research. The smaller file size exactly fits the settings for the default-numeric archive setting. A check with the REST API for the last 4 houres shows values for every minute in those cases.
So the exact question is now: Why does rrd4j use the default archive setting although a different setting was desired?
It could be that the desired setting doesn’t fit ( desired to store a value below min or above max) or the item has been set into the rrd4j.persist before it has been added to the rrd4j.cfg.

how can you check datapoints via REST?

I have installed “REST Documents” via PaperUI.
Having that you can either use the REST API UI or do webcalls like:

http://[OpenHABServer]:8080/rest/persistence/items/[ItemName]?serviceId=rrd4j&starttime=2018-03-31T00%3A00%3A00.000Z

With all data within "[ " “]” from your system, rrd4j as the name of the persistence service and a starttime as you see, I ommited the endtime which will default to now.

However checking datapoints in rrd4j you need to understand that database. When checking my rrd4j as posted above checking for a timeframe of up to 24 houres I would get the points from archive 1, beyond that up to a week archive 2 and longer then that archive 3.

As discussed in Here, the solution was: Do not use spaces in the .cfg files and (probably) do not store values outside the max and min. Big thanks go to @binderth