openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

Performance issues with rrdj4 #16354

Closed jlikonen closed 8 months ago

jlikonen commented 9 months ago

Expected Behavior

I’m running OH4.1.0 on a Win11 box (Intel NUC8i with 16GB RAM) and now rrdj4 seems to be rather slow when I click analyzer for any Item. Sometimes the graph opens up almost instantly but in many cases it may take up to 10-20s to plot the values of an Item. See the discussion in the openHAB forum.

Current Behavior

Possible Solution

Steps to Reproduce (for Bugs)

  1. Navigate to Developer Tools → API Explorer → Persistence and query for some data and see how long it takes.
  2. Enable debug level logging by typing in Karaf: log:set DEBUG org.openhab.persistence.rrd4j

I ran a query for Item Nibe_S1255_UlkoT several times (see the attached screen copy). When the previous query had finished I pressed the Excute button immediately.

a6cf5f96d27e5d3afe78792ae73c51540e9c4b34

In the openhab log I have entries:

2024-02-01 17:41:57.651 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.6' with timestamp 1706802116 in rrd4j database
2024-02-01 17:41:52.571 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.5' with timestamp 1706802111 in rrd4j database
2024-02-01 17:41:47.735 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.6' with timestamp 1706802106 in rrd4j database
2024-02-01 17:41:42.211 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.5' with timestamp 1706802101 in rrd4j database
2024-02-01 17:41:27.964 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.6' with timestamp 1706802060 in rrd4j database
2024-02-01 17:40:39.561 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.6' with timestamp 1706802029 in rrd4j database
2024-02-01 17:40:39.491 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.5' with timestamp 1706802024 in rrd4j database
2024-02-01 17:40:30.310 [DEBUG] [d4j.internal.RRD4jPersistenceService] - Stored 'Nibe_S1255_UlkoT' as value '1.6' with timestamp 1706802000 in rrd4j database

We can see that the response is very slow in some cases when looking at the timestamps.

Context

Your Environment

jlikonen commented 8 months ago

It seems that Issue #16360 fixed this problem.