Why so sluggish at times?

Hi everyone,

I have a sluggish system and have done a bit of poking around and was hoping for some thoughts.

Some back ground:
System is UI5, I am using z-wave 2.78 L:1 and have UN ticked ?Use Vera routing instead of Z-Wave (requires 4.5)? & ?Limit neighbors to Z-Wave discovery (requires Vera routing)?. I have done this so I have full control of the mesh network and so that Vera does not play with things over night. I have run a Heal several times and all devices show a good connection. (e.g. 3 starts or more)

I have circa 90 devices listed under devices (mixture of timers, virtual switches, and actual devices) and I have circa 130 scenes. I am currently working to reducing the scene count by getting better at writing LUA as currently have for example one scene that uses three as I don?t know the correct syntax for the LUA. It works however.

I have checked CPU and Memory usage and this seems within normal use / boundaries.

The Vera restarts luup once a day as requested via a scene to keep things running smoothly.

I have checked the log via http://MYIPADDRESS/cgi-bin/cmh/log.sh?Device=LuaUPnP and can?t see anything that glares as abnormal.

The main issue:
The system on occasions (read most of the time but not all the time) behaves slowly. When I mean slowly I mean there is sometimes as much as a 10>20 second delay. An example is a motion sensor is tripped and light comes on; sometimes immediately, sometimes after 20 seconds of waiting. The same ?delay? scenario happens throughout the Vera system.

My Question:
So what causes the ?delays?? and what else can I try to identify where the delay happens, and for what reason?

Thank you in advance.

Some hints from my experience to improve speed on vera:

  • Don’t use the ergy plugin.
  • Use PLEG instead of scenes (I reduced my scenes from about 70 to 12).
  • Use a USB Stick for Logging.
  • Be carefull with calling URL’s in scenes LUA code, this caused random delay’s for me.
  • I do a nightly reboot (complete, not just Luup, this frees much more memory).

You need to post more detailed information. What Vera unit, what’s the cpu and memory readings. What plug-ins do you have installed?

  • Garrett

[quote=“chixxi, post:2, topic:178006”]Some hints from my experience to improve speed on vera:

  • Don’t use the ergy plugin.
  • Use PLEG instead of scenes (I reduced my scenes from about 70 to 12).
  • Use a USB Stick for Logging.
  • Be carefull with calling URL’s in scenes LUA code, this caused random delay’s for me.
  • I do a nightly reboot (complete, not just Luup, this frees much more memory).[/quote]

How do you do the nightly reboot ?

Hi there,

- Don't use the ergy plugin.
I have made sure I do not have this already as saw posts to the same.
- Use PLEG instead of scenes (I reduced my scenes from about 70 to 12).
I have not had time to fully learn PLEG yet but am working to reduce scenes via improved LUA coding. A discussion in the PLEG thread identified that LUA however is faster than PLEG as PLEG adds an extra layer of coding so the only advantage for speed is less scenes so a little less memory usage perhaps ? I am not convinced on the full benefit of me moving over to PLEG just yet?
- Use a USB Stick for Logging.
Yep doing this for datamine
- Be carefull with calling URL's in scenes LUA code, this caused random delay's for me.
This could be interesting? So I do call URL?s in some code. I use it to communicate on my lan with an IP camera and to trigger events on another PC for other tasks ? any more info on this?
- I do a nightly reboot (complete, not just Luup, this frees much more memory).
Also interested in how you do a full reboot ? not with code I assume but with a basic timer switch? I did read somewhere it is possible to do it via code but voided warranty or similar?
What Vera unit,
Vera 3 running UI5 and firmware 1.5.622
what's the cpu and memory readings.
From sysmon: Mem Available 86136 kilo bytes CPU Load (1 minute)0.28 CPU Load (5 minute)0.32 CPU Load (15 minute)0.31 Last CMH Reboot 20:38:07 Wed 27 Nov 2013 Last Vera Restart 20:39:31 Wed 27 Nov 2013 Last Luup Restart 03:30:32 Thu 28 Nov 2013
What plug-ins do you have installed
Virtual ON/OFF Switches 1.3 Countdown timer 6.0 Combination Switch 10.0 dataMine graphing and logging 0.980 WakeUp Light 0.9 Smart Virtual Thermostat 2.5 Ping Sensor 0.16 Program Logic Event Generator 5.3* Program Logic Core 5.3* Program Logic Timer Switch 5.3* MiOS Update Utility 1.0 Virtual Clock 0.7 VeraAlerts 3.95 System Monitor

Hope this helps?

-LightsOn

For a complete reboot I use this code in a scene (with schedule):

os.execute("reboot")

USB Logging:
I wasn’t talking about DataMine. When you go to Setup=>Logs there is another option for logging the vera logs to usb.

PLEG:
I don’t know if PLEG or LUA is faster. But using PLEG I was able to make my logics much more efficient. I did, just like you, have scenes which executed other scenes. And PLEG is much easier to learn than LUA code. I am doing stuff in PLEG which I would have never achieved in LUA, learning curve is much steeper with PLEG.

URL’s:
For example I used to have an AllOff Scene which turned everything off. Including TV, Dreambox and so on with a RedEye IR-Blaster. This was done by using URL to make the RedEye send IR commands. When I executed the scene, I had random delays in between 2 to 30 seconds. I never analyzed this, but it seemed like the vera was waiting for responses or just wasn’t able to send the command when the redeye was down. I now have this separated and the AllOff scene turns of about 30 lights within half a second, everytime!

Check your Plugin Versions, some of them are outdated (i.e. Virtual Switch, PLEG…)

Keep in mind, this is just my experience, I don’t know if everybody would confirm this. But I have about then vera’s running for friends an family, and they all seem fine.

Hi @lightson

I’m wondering is there any difference in the response time when you run a local (Vera only task) something that is not linked to a physical z-wave device? In the example you gave, there was a gap between the sensor reacting (to motion/trip) and the target responding (turning a light on)

What would happen if you were to just set something up so that when you turn on one virtual switch it triggers another virtual switch to come on? I’m curious if you were to remove the z-wave network from the equation would the delay still occur?

If it works quickly all times , yet it’s delayed with the physical devices, it could point to the zwave mesh network not playing ball. maybe packets are getting blocked/lost on certain routes (maybe at certain times due to interference ) or possibly the route is just not optimal… (And requires some request to be resent)

I’m just thinking out loud , hoping some may be of help…

@Chixxi

I will try the reboot with ?os.execute(“reboot”)? will likely be better than a lua restart. Thank you.

USB logging to a USB stick separately I have not done ? you are correct. I will get a small hub and connect 2 USB sticks to it ? one for logging and one for data mine. Or can I partition one USB stick to two partitions? I use the other USB port for RFX so need another if partitioning won?t work I will need to use a hub. Does logging to a USB stick offer any major benefits? E.g. saved space so improved memory / CPU?

I agree that PLEG is likely the way to go long term, but if the main benefit is reduced amount of scenes and increased learning curve then for now I think I am best suited to fixing the delays and then looking to tweak / improve using PLEG. Unless you specifically think I should go about this differently? I am working on the improved LUA here:

http://forum.micasaverde.com/index.php/topic,17783.0.html

but if you think this is easy to turn into PLEG I am happy to try if you can help? I have spent a few hours so far reading up on PLEG and am still a little out of my depth. I am certain I will pick it up when the penny finally drops but seemed not the right time for me to learn what with the sluggish response issue appearing a bigger problem ? but happy to sort a few things at once I suppose 

My URL calls are not day to day stuff and are only used at certain points and are in the main standalone so I think I should be okay here. It sounds like you had issues as part of a wider scene and since I don?t have this and I already have the URL?s as good as separated then fingers crossed I should be good here. 30 Lights off in half a second!!! I am in awe!!! I have never had such a timely response with any 1 single switch let alone 30 from a scene ? I defiantly have to get this sluggishness sorted!

Good point regarding the plugin versions ? I shall update these.

@Parkerc

So I agree with your thinking. I too have a gut feeling that the issue lies with the mesh network. I think this because where I have the setup installed I too have a router in bridge to another to help wireless range. Yet the two routers are only say 10 meters apart as the crow fly?s, so an unusual set up. It just seems that where I have the install, signals are troublesome; many years of old layered led paint on the walls perhaps? Who knows? But perhaps this is a reason that slows down the mesh network as well?

I have tested the VSwitch to VSwitch and this works fine. Switching one triggers a scene that switches another. Always works instantly.

So how do I begin to diagnose lost packets? In the logs? If the heal shows good connectivity, how do I then confirm routing is in fact reliable?

Summary so far:
? Sort logging to USB stick
? Investigate further possible mesh network issues (dropped packets perhaps?)
? Update all plugins to latest releases
? Use PLEG instead of LUA where possible (lower level priority believed but worth perusing)
? Ensure URL calls are stand-alone (Done)

Thank you 
-LightsOn

If you get a USB hub and connect 2 USB sticks one for datamine and one for Vera logging I suggest you try to somehow backup your datamine USB drive from time to time.
I used to have this kind of setup and for me it happened that vera for some reason lost the connection to the USB drives.
Then when it again got connected it somehow confused the 2 drives and vera formatted the datamine drive for its own logging so all datamine data was lost.
This happened for me a few times so I decided to stop using vera logging to USB.

There is a discussion about this in some datamine tread.

Now I have started to run out of memory so now I’m thinking about trying it again.

-Tomas

Hi @korttoma

Thank you for that.

So logging to the USB stick saves memory then for certain. Okay. so this is a benefit then.

I have noticed that my datamnine set up has indeed lost connection also - will need to look at this later and set it up again.

Agreed that having the datamine information wiped by Vera is a real pain. Have you tried the partitioning of one USB drive instead of using a hub and 2 drives?

[quote=“LightsOn, post:8, topic:178006”]@Parkerc

So I agree with your thinking. I too have a gut feeling that the issue lies with the mesh network. I think this because where I have the setup installed I too have a router in bridge to another to help wireless range. Yet the two routers are only say 10 meters apart as the crow fly?s, so an unusual set up. It just seems that where I have the install, signals are troublesome; many years of old layered led paint on the walls perhaps? Who knows? But perhaps this is a reason that slows down the mesh network as well?

I have tested the VSwitch to VSwitch and this works fine. Switching one triggers a scene that switches another. Always works instantly.

So how do I begin to diagnose lost packets? In the logs? If the heal shows good connectivity, how do I then confirm routing is in fact reliable?[/quote]

Hi @lightson

If you are referring to a wifi network that is next to Vera then that would run on a different frequency (e.g 2.4ghz) so should not interrupt with your z-wave network (e.g .868mhz)?

Thick walls and other factors like steel will effect how your mesh performs which means z-wave traffic can be affected on route. Also you could be over loading a single node in one area of your mesh, maybe one is listed in all of the neighbours and is the bottle neck.

There is plugin called Info Viewer that will provide you with a visual representation of your z-wave nodes and show you who are listed as their neighbour .

A test could be to see the reaction times of nodes that are in visual range of your Vera, you may need to exclude and re-include a couple just so it picks up it’s new neighbours. If that works then check how many powered nodes you have that act as re-transmitters (in that they will accept and route requests) - battery powered devices as I’m sure you know do not do this. If you can sketch out your mesh network and see if certain routes to end devices respond quicker than others. (It’s possible adding a powered node at a certain point could improve things.

(Although I think there’s a limited number of hops you should have on a route, but not sure where I read that)

Hi @Parkerc
Agreed wireless networks and zwave networks are on different frequencies but I was, as you picked up on, wondering if environment was impacting upon reception / transition for these devices. (Thick walls, steel joists etc.)

I have installed Info Viewer, played with it once before, and it is a great tool. I like the idea that I may have a bottle neck however will need to look further into this. I guess I just look for where the ?@? symbol appears most as to identifying the most popular node as a neighbour?

@korttoma
I have now set DataMine to work on one usb stick and have set up usb logging for vera on another however I have the rfx kit working of sda1 so sdb1 has a hub on it with the two usb sticks attached. Data mine picked it up fine and I was able to select the stick I wanted however how do I check vera logging is using the other stick? As if it is not I am mounting twice on one stick right? Is have ssh and run ?mount? but just see sda and sdb ? no way of telling what is happening on sdb with each drive ? or at least from what I understand I see? Anyone have any thoughts here as to how I can confirm my configuration?

I am going to update the plugins and do a little work on some luup now and then I can go over the overview again to see if I have made some progress.

Any thoughts on the USB mounting part would be a really help at this stage.

Thank you.
-lightsOn

defiantly got some USB issues with the logging I think?

Enabled Mounted: read-only Usage: 3%

Errors log:
2013-12-01_15:40:41 CHECKDISK: Starting to check device: /dev/sda1 with: /usr/sbin/e2fsck
2013-12-01_15:40:56 (/dev/sda1) : ERROR: Uncorrected errors.
2013-12-01_15:40:56 [mount_usb] Checkdisk FAILED with exit code : 4. Trying to recover UsbStick
2013-12-01_15:40:56 [recover_usb] CHECKDISK failed. Re-formating drive

data mine is working fine but not convinced vera usb loggin is using the correct stick every time as never set it anywhere - can I do this?

…nothing like fixing another problem to help fix the actual problem!! ::slight_smile:

-LightsOn

Sorry, I don’t know how to make sure this setup is working correctly. This is why I no longer dare to use vera usb logging since for me it formatted my datamine usb a few times. I also use the RFXtrx433.

Hiya,

okay well this may bee a need for more investigation then so I have posted in the datamine thread to see if someone knows there.

I will post in bioth if I find a reliable soloution.

…onto luup then plugin updates then test system again.

so how do I update the v switch app with out uninstalling it and re installing it? this would be a nightmare if I had to do this as all switches would be removed in uninstall!

The v_switch plugins look to the installed .xml files, so you should just need to update those in the back end and reload a few times for it to benefit from the changes. If you have loaded it via the App Store the you can run the http update request.

http://vera_ip:3480/data_request?id=update_plugin&Plugin=Plugin_ID

[quote=“LightsOn, post:13, topic:178006”]defiantly got some USB issues with the logging I think?

Enabled Mounted: read-only Usage: 3%

Errors log:
2013-12-01_15:40:41 CHECKDISK: Starting to check device: /dev/sda1 with: /usr/sbin/e2fsck
2013-12-01_15:40:56 (/dev/sda1) : ERROR: Uncorrected errors.
2013-12-01_15:40:56 [mount_usb] Checkdisk FAILED with exit code : 4. Trying to recover UsbStick
2013-12-01_15:40:56 [recover_usb] CHECKDISK failed. Re-formating drive

[/quote]

I think the first part is the most important - while it’s enabled, it’s mounted only as read only - when it should be read-write

Hi @Parkerc

Thank you for the reply.

The USB loggin is an on-going issue apparently as discussed here:

http://forum.micasaverde.com/index.php/topic,7750.705.html

as such I intend to only log via USB from vera and instead send DataMine to a NAS (or similar share) thus removing the issue of 2 USB sticks and thus datamine and Vera USB logging conflicting - this is on the to do list this week if I have time but I feel will be the solution as others have achieved it so just a case of implementing… famous last words!! ;D

I have not heard of this update command before - will look into that, but yes I did install via the mios so your suggested command should work - is there a wikki I missed on this? I agree otherwise I could update the back end with .xml files etc but came to a ? when looking for this for virtual switch (as installed via mios) - this auto update is probably why.

many thanks.

…getting there slowly…and all worthwhile tasks.

-LightsOn

Update:

I have now set up logging to a single USB and datami.e to w7 share, all seems to be working great.

@parkerc could you explain further about the update URL you mentioned, I can’t see any further info on it in the forum and have tried running it as I would asume it would be run but with no luck.

After updates to plugins next is to sharpen my lua then last thing I guess will be to review the logs and hopfuly find what, if anything, is causing remaining sluggishness.

Sent from my HTC HD2 using Tapatalk 2

Well done, you have achieved something I still can’t get to work :wink: feel free to share more on ‘exactly’ what you did in the DataMine board.

Have a look at this link - http://wiki.micasaverde.com/index.php/Luup_Requests#update_plugin