[SOLVED] High CPU Load for 3 days after adding 2 Items in InfluxDB

Hi there,

I am using Openhab in a Raspberry Pi 3. Everything works fine.

  • I have 1 rule which runs every 5 minutes. No more rules under Time cron.
  • I have severals (15 more or less) Items storing data in influxDB to be shown in Grafana.

With this setup I got my CPU usage <10% all time.

But, last 28th I setup 2 more parameters to be store in influxdb, and a formula in the rule which is running every 5 minutes. That was all, and as you can see on the picture, the CPU load (on green) is around 30% all time. The Load went down after 29.12 at 12.00 because I restarted OH, but then increased again till around 30%.

How is possible that only 2 more Items may cause this higher load?

The Items are Power Consumption. I have installed SDM630 Modbus 2 weeks ago and I receive this info of the consumption from the SDM630, and until 28th I did not setup the Items in InfluxDB and Grafana.

There is no picture.

Is the CPU load coming from openHAB or are you just watching the load over all?

1 Like

Note that Modbus is a polling binding, and updates Items at each poll by default. User often set polling intervals to less than a second.

So a persistence strategy of “every update” can cause a fair amount of work for the persistence service. Even “every change” can, if the polled data is jittery (as is often the case with power meter readings). Writing to slow storage SD might cause noticeable backlogs.

For modbus, there is a newly developed enhancement to circumvent the standard openHAB behaviour, by only updating Items when polled data changes. But this is only available in snapshot version for now.

If your root cause is jittery data, that won’t help.

1 Like

Same comment from my site. “every Update” is very critical for items connected to polling bindings. I had 100 items of thsi sort and OH was no longer able to react in a normal way. After changing this to “every change” the problem was gone.

I use “every update” in no case at the moment because I do net see a reason why.

1 Like

Hi there,

Thanks for the answers. I have crosscheck my strateies. I only use “every change” on my strategies but only for 2 items, the rest items use strategy “every Minute”. However, I have realized that I had one Item in the persist file which was not declarated on the Items File, and I think this Item non declarated was producing the high Load. I deleted yesterday this item from the persist file and now the CPU Load goes pretty well, as you can see: