High CPU Usage with network binding

Hello there,

First of all: I am unsure whether this issue belongs in the community or as a github issue. Feel free to tell me to open this on github.

I am facing the issue that my openhab installation produces a huge cpu load if I try to use the network binding to ping devices. As soon as I define a thing like

network:pingdevice:Netzwerk_System_Asterix  "Netzwerk_System_Asterix"@"System" hostname="", timeout=1000, refreshInterval=2000, retry=2]

and enable the binding the load on my system jumps from 0.4 to 2-3.

I looked where the issue might lie, this is what I found:

  • Using an IP instead of the hostname doesn’t help, so its not a DNS problem
  • Every combination of parameters of the binding
    don’t help. I also tried to set /bin/ping instead of airping. Still the high usage.
  • If I open the docker container openHAB runs in and manually execute a bunch of airpings the cpu doesn’t seem to take the same effect

So it has to/I suspect it has to do with the openHAB instance itself.

I am running openHAB 3.4.5 inside a Docker container on Ubuntu 22.04.

Did anyone else experience this issue?

Greetings Felix

Do you really want to check this device every 2000 msec ( i.e. 2 seconds)?
A higher setting would most probably bring the CPU usage down.

I vaguely remember there being an issue and PR that went by concering this for the network binding. About the best I can offer, in addition to @opus suggestion to increase the polling period, is to try it out in OH 4. If it’s still definitely a Networking binding problem to file an issue.

I’m running OH 4.0.3 Release Build on a Raspi4 with 4GB.
For the network binding I’m using Allow Sytem Ping and Allow DHCP Requests.
My two (smartphone) things are polled with the settings of refreshInterval: 60000, retry: 5 and timeout: 5000.
I do log the load of my raspi and it stays below 1% most of the time( analyze graph shows 1% as 0.01!). The higher values correlate with backups or manual interactions with the system. I did not see other value when running OH3.

Yes. I use the network binding to determine if the target device (my desktop computer) is online and toggle some lights as a consequence.
Until I this issue appeared I never had any problems with such low intervals, even with about 20 devices being pinged every 1-5 sec.

I think I found the issue. Thanks for pointing out!
There is also a possible solution linked, will try that.

1 Like