- Platform information:
- Hardware: x86_64/16 GB
- OS: Ubuntu 22.04.2 LTS
- Java Runtime Environment: OpenJDK 64-Bit Server VM Zulu11.62+17-CA (build 11.0.18+10-LTS, mixed mode)
- openHAB version: 3.4.2
Hi,
Since I upgraded from OH 2.5 to OH3 I’m experiencing a extreme slowness when executing the first command in a rule with executeCommandLine. A single Linux “echo” command takes from 20 seconds to a minute and a half (variable), but subsequent commands in the same rule run normally fast.
As an example:
rule "Slow"
when
Item Slow changed
then
logInfo("SLOW_CMD","Start echo SLOW 1")
logInfo("SLOW_CMD",executeCommandLine(Duration.ofSeconds(300),"time","echo","SLOW"))
logInfo("SLOW_CMD","End echo SLOW 1")
logInfo("SLOW_CMD","Start echo SLOW 2")
logInfo("SLOW_CMD",executeCommandLine(Duration.ofSeconds(300),"time","echo","SLOW"))
logInfo("SLOW_CMD","End echo SLOW 2")
end
I’m executing “time echo SLOW”, which prints “SLOW” and tells me how long it took. In the Linux console I get this:
SLOW
real 0m0,000s
user 0m0,000s
sys 0m0,000s
As you can see, the “echo” command takes almost no time to execute.
But in openHAB I’m getting results like this:
2023-03-20 15:33:28.639 [INFO ] [g.openhab.core.model.script.SLOW_CMD] - Start echo SLOW 1
2023-03-20 15:34:17.151 [INFO ] [g.openhab.core.model.script.SLOW_CMD] - SLOW
0.00user 0.00system 0:00.00elapsed 91%CPU (0avgtext+0avgdata 2080maxresident)k
0inputs+0outputs (0major+88minor)pagefaults 0swaps
2023-03-20 15:34:17.151 [INFO ] [g.openhab.core.model.script.SLOW_CMD] - End echo SLOW 1
2023-03-20 15:34:17.151 [INFO ] [g.openhab.core.model.script.SLOW_CMD] - Start echo SLOW 2
2023-03-20 15:34:17.158 [INFO ] [g.openhab.core.model.script.SLOW_CMD] - SLOW
0.00user 0.00system 0:00.00elapsed 86%CPU (0avgtext+0avgdata 2060maxresident)k
0inputs+0outputs (0major+87minor)pagefaults 0swaps
2023-03-20 15:34:17.159 [INFO ] [g.openhab.core.model.script.SLOW_CMD] - End echo SLOW 2
The first echo command was immediate according to time (and the time command output is different, I don’t know why) but it took openHAB almost 50 seconds to return from execution.
The second echo command was fast.
Anybody else is experiencing this? Is there any way to debug it?
Thanks.