OpenHAB slowing down

I have been having this problem for a while now where OpenHAB 2.4 will slow down over time especially if its been running for over a day. The effects of this are outside lights that should come on at dark come on 30 - 90 min late. When I enter my driveway the announcement will also be 30 - 90 min late and so on.

Any ideas on how I can track down where this is coming from? I thought it may be modbus2 so I have been looking at modbus to mqtt gateway, but I hate to go through all that work if it is some other binding.

Hardware is a dual Xeon E5-2690 at 2.9 GHz with 64 gigs of RAM so I don’t think it’s my hardware.

binding = http1,mqtt1,mios1,insteonplm1,astro,expire1,networkhealth1,lifx,dmx,serial1,modbus,miio

You could try disabling one binding at a time to rule out if and what binding.

Maybe look at using wireshark to capture the packets and see if that helps identify where the hangup occurs.

I’m sure you’ve tried cleaning the cache but thought I would mention it for anyone else reading this.

Best of luck and please post your findings

So I was searching the archives and stumbled on my own post years ago. It turns out it was db4o…

NICE!
not only figure out your problem yourself but… use your own post to do so!!! :laughing:
maybe mark the thread as [SOLVED]

With the hardware you are running on, it might be worth moving to a different database, something external rather than embedded. MySQL/MariaDB and InfluxDB tend to be the most popular. I run with InfluxDB and haven’t had any problems. Migrate your existing persistence data to InfluxDB provides instructions and some scripts that you could use or modify and use to extract the data from your existing db4o and save it to a different database so you wouldn’t lose anything.

I notice that db4o isn’t listed among the official persistence addons so support might be harder to come by as time goes on.

1 Like

FTR, for any similar future issues: I just helped analysing a similar report and taking a stacktrace of your runtime usually helps to identify the culprit very easily, see here.

1 Like

Thanks for the info but I’d like to follow up on that.
Unlike in your linked post and as most people, I use UNIX (Raspbian) and Zulu Java.
On my openHABian/buster on RPi3 I get the following:

[13:06:05] root@openhabianpi:/home/openhabian# jps
30163 Jps
1511 Main
[13:06:09] root@openhabianpi:/home/openhabian# jstack 1511
1511: Unable to open socket file: target process not responding or HotSpot VM not loaded
[13:06:28] root@openhabianpi:/home/openhabian# 

devstack says to use the same user java is running under, but “openhab” per default has /bin/false as its shell so it isn’t that easy.

Can you or someone else publish how to get it installed and working with Zulu on either ARM or x86 ?

It’s not so hard.

sudo -u openhab /bin/bash

That will give you a shell running as the openhab user. Then you can run those commands in that shell.

I tried to do this with my instance running in Docker but jps can’t see the process, whether I run it inside the container or outside the container.

But when I tried to run it on my manually installed openHABian on my RPi3 (i.e. I installed Raspbian Lite and then manually ran the openHABian scripts) it worked like a champ.

rich@norns:~   sudo -u openhab /bin/bash
[10:29:30] openhab@norns:/home/rich$ jps
26534 Main
15373 Jps
[10:31:32] openhab@norns:/home/rich$ jstack 26534
2019-10-16 10:31:39
Full thread dump OpenJDK Client VM (25.152-b76 mixed mode, Evaluation):

"OH-discovery-2928" #8421 daemon prio=5 os_prio=0 tid=0x5903fc00 nid=0x3c23 waiting on condition [0x58d3a000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x65ae6e80> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1073)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

"OH-scheduler-1463" #8420 daemon prio=5 os_prio=0 tid=0x55bf3800 nid=0x3c0c waiting on condition [0x5797d000]
   java.lang.Thread.State: TIMED_WAITING (parking)
...

If you don’t want to open a shell as the openhab user, you can run each command using sudo -u openhab individually.

sudo -u openhab jps
sudo -u openhab jstack <pid>
1 Like