- Platform information:
- Hardware: Cubietruck Allwinner A20 armhf 2GB RAM
- OS: Debian (Armbian) Jessie
- Java Runtime Environment: Zulu 8
- openHAB version: 2.4.0
Last couple times I ssh in to my openHAB server running on Cubietruck, I notice high system load:
System load: 4.17 4.87 4.15
Doing htop shows openhab hogging a lot of resources:
1 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] Tasks: 47, 251 thr; 12 running
2 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.0%] Load average: 11.55 12.27 14.03
Mem[|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||842/2010MB] Uptime: 26 days, 11:29:25
Swp[|| 16/1005MB]
PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command
25699 openhab 20 0 491M 367M 13840 S 157. 18.3 71h13:01 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
26980 openhab 20 0 491M 367M 13840 R 30.0 18.3 1h22:54 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
22779 openhab 20 0 491M 367M 13840 R 28.8 18.3 1h25:23 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
30438 openhab 20 0 491M 367M 13840 R 27.6 18.3 1h21:15 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
19738 openhab 20 0 491M 367M 13840 R 26.5 18.3 1h27:42 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
26999 openhab 20 0 491M 367M 13840 R 22.9 18.3 1h22:58 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
26145 openhab 20 0 491M 367M 13840 R 13.5 18.3 7h29:17 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/open
So I start to investigate. I search forums and internet and find similar threads about high CPU usage. In those threads I found some commands to issue in openHAB console like threads --list
which I executed and found several threads with high CPU time:
211 │ ESH-usb-serial-discovery-linux-sysfs-1 │ TIMED_WAITING │ 26523307 │ 17697940
2188 │ Thread-105 │ RUNNABLE │ 31352788 │ 9442970
2585 │ Thread-112 │ RUNNABLE │ 30686536 │ 9191600
2595 │ Thread-113 │ RUNNABLE │ 30693875 │ 9184630
14123 │ Thread-247 │ RUNNABLE │ 30432034 │ 9089630
14130 │ Thread-248 │ RUNNABLE │ 30437704 │ 9083700
14455 │ Thread-250 │ TIMED_WAITING │ 1 │ 0
31916 │ Thread-432 │ RUNNABLE │ 5877711 │ 1642970
31926 │ Thread-433 │ RUNNABLE │ 5881276 │ 1651180
32575 │ Thread-440 │ RUNNABLE │ 5514174 │ 1505700
37395 │ Thread-488 │ RUNNABLE │ 5187324 │ 1384310
37791 │ Thread-493 │ RUNNABLE │ 4983929 │ 1309180
37808 │ Thread-494 │ RUNNABLE │ 4983894 │ 1309570
73507 │ Thread-864 │ TIMED_WAITING │ 0 │ 0
73521 │ Thread-865 │ RUNNABLE │ 4379802 │ 1182390
73805 │ Thread-869 │ TIMED_WAITING │ 0 │ 0
80504 │ ESH-discovery-9000 │ TIMED_WAITING │ 3102 │ 2540
81670 │ Thread-960 │ RUNNABLE │ 3581328 │ 1158900
83671 │ Thread-985 │ RUNNABLE │ 3441377 │ 1100270
86184 │ Thread-1015 │ RUNNABLE │ 3295117 │ 1042530
86199 │ Thread-1016 │ RUNNABLE │ 3294444 │ 1042790
88440 │ Thread-1044 │ RUNNABLE │ 3191726 │ 1002800
Thread-xxx
does not tell much so I issue command threads xxxx
on several (not all) and they all said the same thing:
openhab> threads 2188
Thread 2188 Thread-105 RUNNABLE
Stacktrace:
gnu.io.RXTXPort.eventLoop line: -2
gnu.io.RXTXPort$MonitorThread.run line: 1611
openhab> threads 2585
Thread 2585 Thread-112 RUNNABLE
Stacktrace:
gnu.io.RXTXPort.eventLoop line: -2
gnu.io.RXTXPort$MonitorThread.run line: 1611
openhab> threads 2595
Thread 2595 Thread-113 RUNNABLE
Stacktrace:
gnu.io.RXTXPort.eventLoop line: -2
gnu.io.RXTXPort$MonitorThread.run line: 1611
openhab> threads 14123
Thread 14123 Thread-247 RUNNABLE
Stacktrace:
gnu.io.RXTXPort.eventLoop line: -2
gnu.io.RXTXPort$MonitorThread.run line: 1611
openhab> threads 14130
Thread 14130 Thread-248 RUNNABLE
Stacktrace:
gnu.io.RXTXPort.eventLoop line: -2
gnu.io.RXTXPort$MonitorThread.run line: 1611
So, it appears something is going on with serial port, but not sure how to diagnose from here?
Only change I can recall making recently was to enable Sanity Check in MySensors binding, because the (USB attached serial) gateway seemed to me to keep dropping out. Since I made that change it seems more reliable, but maybe that caused this? Prior to that I never noticed anyway problems like this.
I suppose I just wanted to touch base here before raising an issue in that binding GitHub to confirm I am on the right track?