Closed olemr closed 3 years ago
Can anyone else from the community confirm the issue on their setup?
I wonder if the differential update optimization done as part of this one will ease the CPU spikes after updates: #6832
Well, I did a test on a RPi4. Same issue, but not so prominent. Added all 4 Zones, CPU goes up to about 100% for 5-10s every 60s The Pi runs openjdk 11.0.6, the Ubuntu Java 1.8.0_201
Still a problem on :
2.5.4 Release Build
254 │ Active │ 80 │ 2.5.4 │ openHAB Add-ons :: Bundles :: Yamaha Receiver Binding
Did a WireShark capture whilst adding the MAIN Zone. https://1drv.ms/u/s!Ak62_W4agNNTogGQWs99jLeWoYkn?e=o8znW7
Looking at the code, I see we have a refresh job scheduled by default every 60 seconds. This job will trigger for each zone the run of 2 until 6 commands, each command being run asynchronously in a separate thread. The used thread pool is the common OH thread pool dedicated to bindings. While the refresh is already run in a separate thread, I see no reason to call the commands asynchronously. They could be run in sequence by the same thread. This would reduce the number of commands run in parallel.
I proposed a fix that avoids starting multiplke commands in parallel in different threads (the used thrread pool has a very limioted size).
@olemr : are you able to test my proposal ? We need someone to confirm that:
I can build and provide the jar file.
Sorry for my late reply. Sure, I'll be happy to test your change/jar.
Do you need I build the jar file for you?
Yes, please. That would be great. I have never done it before ... (Or does it just involve pressing a button in Jenkins somewhere?)
Here is a jar for testing: org.openhab.binding.yamahareceiver-2.5.6-SNAPSHOT.zip
Thanks. Sorry to say, it behaves exactly as the old one:
2.5.5
Release Build
openhab> list | grep -i yama
284 │ Active │ 80 │ 2.5.6.202006031211 │ openHAB Add-ons :: Bundles :: Yamaha Receiver Binding
Uninstalled the old binding, copied the .jar and restarted OH2
Ok, thank you for the test, I will close my proposal in this case.
Just re-tested on 2.5.8, still the same. As soon as I add the Main Zone, the CPU hogging starts.
Re-tested on OH3.0.0 Release Build and now all is OK.
My environment: openhab 2.5.2 Release Build, x64 platform, Ubuntu Server 18.04 LTS 286 │ Active │ 80 │ 2.5.2 │ openHAB Add-ons :: Bundles :: Yamaha Receiver Binding
This issue is 100% reproducible using my Yamaha RX-A3020 (fw 1.98) wired Eth LAN. After installing this item, all is fine, CPU usage is normal 5-6% watched over a period of several minutes. :
After installing MAIN Zone, CPU usage spikes to 100-150% for 5-10s every 30s.
This is the trace log from 2 such periods. Note how the log entries only last for some 150ms out of the 5-10s period:
Adding more Zone things, Zone2,3,4 the issue gets worse, flattening out on a continuous CPU usage of 180%. After deleting all zone things, CPU usage is back to normal.