We have moved at community.getvera.com

Author Topic: Verabridge command queuing idea  (Read 990 times)

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Verabridge command queuing idea
« Reply #15 on: January 18, 2019, 06:17:03 pm »
Indeed, I am actually working both angles. I have managed to get the Vera to run faster by taking out unused services and upgrading a bunch of packages...
« Last Edit: January 19, 2019, 10:36:38 am by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: Verabridge command queuing idea
« Reply #16 on: January 19, 2019, 06:15:23 am »
So far the job code has been working ok.

I may just make that change permanent, then.  It's something I've thought about for a long time, witness the comment that's been in the code from almost day one, and also that the function name is 'job' !

Code: [Select]
  return {run = job}    -- TODO: job or run ?

Is there less perceived delay in operation compared to the luup.sleep(100) experiment?
« Last Edit: January 19, 2019, 10:01:50 am by akbooer »
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Verabridge command queuing idea
« Reply #17 on: January 19, 2019, 11:32:15 am »
Yes I was going to comment that you apparently had a hesitation on the question and it was on your to do list. I don't see any problem going with a job run at this point so you can have one of your TODOs checked out! ;)
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Verabridge command queuing idea
« Reply #18 on: January 22, 2019, 01:07:24 pm »
After a few days and scenarii tested, I can definitely say the "job" change makes a huge difference. What I initially believed was a problem with zwave command queuing, with zwave being the bottleneck, now I am convinced that it was the luup API on the vera not able to handle the amount of commands I was sending it. I now have memories of provoking Luup reloads when one of these busy scenes was running and trying to get homewave mobile app to update status at the same time, which of course is an http call to provide a full device status update. Knowing that openLuup is also regularly polling the vera, and the various mios server calls (remote access especially), it was probably the cause for a number of luup reloads. This is a significant step forward towards my goal of only one reload a month.

PS: These large scenes now run faster also
« Last Edit: January 22, 2019, 01:09:09 pm by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: Verabridge command queuing idea
« Reply #19 on: January 22, 2019, 01:28:59 pm »
Well, that's progress.

I've always been able to take down a Vera with too many HTTP requests, but I've never had a problem with openLuup crashing any of its bridged Veras, although it's quite possible that I've not tried too hard.  Also, I'm running openLuup on a RPi, not anything faster.

The latest development branch already has the change.
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Verabridge command queuing idea
« Reply #20 on: January 26, 2019, 12:14:02 pm »
I have been looking at the cpu utilization and indeed the vera cpu can make enormous swings and remains at 100% when it handles a string of commands. Encouragingly, it seems like it is running on both threads of the core.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: Verabridge command queuing idea
« Reply #21 on: January 28, 2019, 12:23:35 pm »
Found a new deeper problem with the vera plus. I managed to reboot it completely attempting to copy files (a lot of them) from it to make a backup through SCP... It seems like it is not just a luup engine issue. Not sure whether I flooded its memory or overheated the CPU just with the sheer amount of file requests. It crashed when transferring very small files which means very high frequency requests coming from the guest computer...
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.