It’s only active if (I think org.openhab.core) DEBUG logging is enabled. And, that’s a good thing, because this “surveillance” is quite performance-demanding in itself.
Generally to @Nodiaque I’d say that no, restarting OH reguarly should not be required. I’m not one of those that think you have to run the latest updates, so mine typically runs for months at a time (it has battery backup - not a UPS as such, but batteries on the RPi).
But, there can be problems, usually they are related to some binding. If something goes wrong in a way that results in an exception/error, the problem will usually be logged if the binding is in DEBUG. But, there are other failure modes that don’t generate logs, and that’s usually thread deadlock or thread exhaustion (OH has quite small thread pools be default, so it doesn’t take much to exhaust them). It can also be that references to resources are kept when they shouldn’t, so that memory consumption grows over time until there’s too little left for the system to operate efficiently. But, in my experience, the thread issues are the most common.
I doubt that your problems are related to your hardware, OS, docker etc. That would be a rare event, like bad RAM or a failing storage device. So, most likely, the problem is with one of the bindings you use.
A good way to find out what’s wrong is making a thread dump when things are “slow”:
The problem is that not that many people know how to read one, and it can’t be a lot of work to analyze it properly. But, very obvious problems will usually be spotted easily. Another option is to enable DEBUG logging for org.openhab.core, which will log a warning for every task that runs more than - I think 5 seconds. The problem is that the number is arbitrary, you can have problems even if the tasks last shorter, and not everything that exceeds the threshold are problems. But, it can give an indication of where the problem is.
It’s even possible to use Java Flight Recorder to “record” what happens inside the JVM when running:
It’s even more job to analyze, but it provides much more details than a single thread dump, show “trends”, memory consumption over time and much more.
To fix such a problem, the problem must first be pinpointed (usually using one of the above methods), after which somebody must make a fix and the fix be released. All this can take some time, and in the meanwhile, you basically have two options:
- Uninstall the problematic binding
- Restart OH on a schedule that allows the problematic binding to not cause too much slowdown.