openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
907 stars 420 forks source link

Extreme CPU and Memory Load since 2.5 Build 1579 #829

Closed RobertHerter closed 5 years ago

RobertHerter commented 5 years ago

Since Build 1579 there is extreme high CPU-Load and Memory consumption.

OSGIEventManager uses nearly tue complete CPU. Reverting to 1578 instantly fixes this.

Even a Fresh install ends up in this, weit no Bundle found causing this.

Testet on an I5 and RPI3 both show same behaviour resulting in an nearly unusable system.

maggu2810 commented 5 years ago

@mhilbush Perhaps you can add a summary of your findings in #861. Perhaps another @openhab/core-maintainers likes it, too and merges the changes. I don't see any critical blocker, but that is normal for the one that submit a change request. So, I am interested in feedback (but perhaps #861 related topics should be added to that topic).

mhilbush commented 5 years ago

Perhaps you can add a summary of your findings in #861

Certainly! I'll do that now.

mhilbush commented 5 years ago

Summarized here.

bjoernbrings commented 5 years ago

Maybe just a side issue, but with snapshot (1607) as well as my productive environment (2.4) ESH-usb-serial-discovery-linux-sysfs-1 takes a lot of load, though I do not use any binding using any usb or serial device. I see this service in most of your debugging taking much load either and being the second most consumer after #861 is solved.

mhilbush commented 5 years ago

@bjoernbrings By default, it polls every 5 seconds (which seems a bit aggressive to me). Fortunately, the thoughtful developer made it configurable. 😄 I'm going to try changing it in runtime.cfg to every 5 minutes to see what happens.

discovery.usbserial.linuxsysfs.pollingscanner:pauseBetweenScansInSeconds = 600

Edit: Sure enough, if you want to tame ESH-usb-serial-discovery-linux-sysfs-1, just put the above line in services/runtime.cfg with whatever pause amount you want.

shutterfreak commented 5 years ago

Just in case you need another benchmark, I'm running 2.5.0~S1601-1 (Build 1601) on a RPi 3B+ running OH for almost 15 days (1296000 seconds) now.

Here's an overview of the most resource-hungry processes (build 1601).

Id Name State CPU time Usr time
61 ESH-OSGiEventManager TIMED_WAITING 90318011 89700470
227 ESH-usb-serial-discovery-linux-sysfs-1 TIMED_WAITING 7184608 4904440
110 pool-5-thread-1 WAITING 2681233 2419920
88854 SocketListener(JmDNS-/192.168.0.109) RUNNABLE 2600052 2445420
179 Thread-80 TIMED_WAITING 2138434 2101060
88848 SocketListener(JmDNS-/192.168.0.10) RUNNABLE 1815205 1689120
88851 SocketListener(JmDNS-/2a02:1810:481f:dc00:db4d:5:5c4d:941a%wlan0) RUNNABLE 1277256 1190630
88845 SocketListener(JmDNS-/2a02:1810:481f:dc00:8e8c:3190:582a:64a7%eth0) RUNNABLE 1270393 1184900
203 pool-26-thread-1 TIMED_WAITING 1083512 954290
240 ZWaveReceiveInputThread RUNNABLE 1079327 810160
109 pool-1-thread-1 WAITING 963790 718210
130 openHAB-job-scheduler_Worker-2 TIMED_WAITING 759120 693390
88855 JmDNS(JmDNS-/192.168.0.109).Timer TIMED_WAITING 736947 686500
129 openHAB-job-scheduler_Worker-1 TIMED_WAITING 722831 659880
32 EventAdminAsyncThread #11 WAITING 470794 419450
33 EventAdminAsyncThread #12 WAITING 469847 418680
59 EMF Reference Cleaner WAITING 461880 239760
28 fileinstall-/var/lib/openhab2/etc TIMED_WAITING 457392 429390
88849 JmDNS(JmDNS-/192.168.0.10).Timer TIMED_WAITING 418765 367320
183 DTLS-Receiver-0.0.0.0/0.0.0.0:50954 RUNNABLE 390140 356660
13 Karaf Lock Monitor Thread TIMED_WAITING 379288 282240
242 ZWaveReceiveProcessorThread WAITING 354837 336360
88846 JmDNS(JmDNS-/2a02:1810:481f:dc00:8e8c:3190:582a:64a7%eth0).Timer TIMED_WAITING 327078 285380
88852 JmDNS(JmDNS-/2a02:1810:481f:dc00:db4d:5:5c4d:941a%wlan0).Timer TIMED_WAITING 322746 284050
123 JmDNS(JmDNS-/192.168.0.109).Timer TIMED_WAITING 308996 287680
181 DTLS-Sender-0.0.0.0/0.0.0.0:50954 WAITING 296296 231650
37 fileinstall-/usr/share/openhab2/addons TIMED_WAITING 237867 208590
8 Active Thread: Equinox Container: 5c8af011-8fc3-4b72-bca2-83f31477445e TIMED_WAITING 160843 137070
55 sshd-SshServer[c1d5e6]-timer-thread-1 TIMED_WAITING 113117 80070
5iver commented 5 years ago

@maggu2810 , should this be closed now that #861 is merged, or are you waiting for some more feedback?

maggu2810 commented 5 years ago

IMHO it can be closed as the issue should be resolved. @RobertHerter if you don't agree because the issue is still present in the next build, please comment.

mhilbush commented 5 years ago

FTR, I confirmed the performance of build 1618 matches my testing with #763 and #861.

RobertHerter commented 5 years ago

For me issue is home with the new build. Thank you for the hard work. So at the Moment only Rest-Doc is not working in 2.5 everything working.