Author Topic: Hardware: What are you using to run openHAB?  (Read 26428 times)

Offline Otje

  • Full Member
  • ***
  • Posts: 214
  • Karma: +6/-1
Re: Hardware: What are you using to run openHAB?
« Reply #30 on: February 26, 2015, 04:47:36 pm »
on Raspberry Pi2: i can not get the OpenHab designer to work on the raspberry.
after further googling the internet i understand that this is not possible, hence i need to run the designer on a remote terminal, like a PC.

it is not a big problem but you have to be aware that you have to copy the modified files to the raspberry everytime. for some this may be a showstopper though...

other than that: all is runnig fine !
VERA Plus, VERA 3 Lite , couple of PIR's, several switch units, wall mounted tablet, Sonos integration with TTS, Temperature sensors, Imperihome, Zwave LED bulbs

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Hardware: What are you using to run openHAB?
« Reply #31 on: February 26, 2015, 05:36:53 pm »
I think most folks using the micro platforms are using them as Runtime only.  In this mode, they're mounting the remote FS and editing on their convention machines.

In my case, I edit (without tools) the files on my Mac, test out the basics there (another openHAB install), and then SSH over the relevant changes when they're ready.

Definitely agree that the workflow could be better.  Apparently OH2 is heading toward a HTML admin tool, which will save folks the headache of a fat/desktop client.

Offline Otje

  • Full Member
  • ***
  • Posts: 214
  • Karma: +6/-1
Re: Hardware: What are you using to run openHAB?
« Reply #32 on: February 26, 2015, 05:56:35 pm »
thanks for the info!

I am intrested to understand if you use the PI with the openhab running on it's SD CARD or did you mount an external drive or maybe to a network NAS?

i want to run graphics also and i did read somewhere that if you work with graphics there will be to many read actions on the SDCARD which may not be good at all.
hence, i would consider to mount a NAS (like i do with datamine and the vera)

is this necessary for openhab?
VERA Plus, VERA 3 Lite , couple of PIR's, several switch units, wall mounted tablet, Sonos integration with TTS, Temperature sensors, Imperihome, Zwave LED bulbs

Offline racarter

  • Hero Member
  • *****
  • Posts: 518
  • Karma: +12/-4
Re: Hardware: What are you using to run openHAB?
« Reply #33 on: February 26, 2015, 06:01:00 pm »
I've installed Samba server on my Pi 2, so I can mount the Pi openHAB folder on my MacBook as a share, run openHAB Designer on there and point it to the openHAB config folder on the Pi.  Saves the hassle of saving files locally then copying them across.   :)
Indigo, Vera Edge (for Datamine only), Everspring and TKBHOME socket switches, SM103 door detectors, Homepro ZRP210 appliance modules, Fibaro relay switches, EZMotion, Heatmiser thermostats, Netatmo Weather, Camera and Healthy Home, Hikvision DVR/CCTV, Sonos, Texecom, Diax motorised deadlock.

Offline Otje

  • Full Member
  • ***
  • Posts: 214
  • Karma: +6/-1
Re: Hardware: What are you using to run openHAB?
« Reply #34 on: February 26, 2015, 06:11:36 pm »
Makes perfect sense, i should have thought about that as wel.. :-[
VERA Plus, VERA 3 Lite , couple of PIR's, several switch units, wall mounted tablet, Sonos integration with TTS, Temperature sensors, Imperihome, Zwave LED bulbs

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Hardware: What are you using to run openHAB?
« Reply #35 on: February 26, 2015, 06:20:45 pm »
thanks for the info!

I am intrested to understand if you use the PI with the openhab running on it's SD CARD or did you mount an external drive or maybe to a network NAS?

I'm running on Odroid C1, but the principals are the same.  For stability, I keep everything I need on the device itself.  It has very few external dependencies.

Logging, persistence etc are all on the local Flash.  If the flash wears out, as it will eventually, I simple drop in another and do a restore and I'm set to go.

I put in changes to the MiOS Binding recently to reduce the amount/size/rate of logs that I generate which will also help.

I switched the C1 over to use a higher read/write spec MicroSD (from PNY), but that's not really needed.  The biggest lump in IO comes from using RRD for the persistence layer.  It writes everything out (at least) every minute and creates a largish IO spike as everything is in distinct files.  At some point I may switchover to MySQL (etc) since they're more likely to be tuned in IO handling.

Offline Otje

  • Full Member
  • ***
  • Posts: 214
  • Karma: +6/-1
Re: Hardware: What are you using to run openHAB?
« Reply #36 on: February 26, 2015, 06:33:55 pm »
Hi

just to make sure i understand correctly... your C1 operating system is on the microsd and your openhab runs from the flash? Ie your openhab folder is located on the flashdrive, correct?
VERA Plus, VERA 3 Lite , couple of PIR's, several switch units, wall mounted tablet, Sonos integration with TTS, Temperature sensors, Imperihome, Zwave LED bulbs

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Hardware: What are you using to run openHAB?
« Reply #37 on: February 26, 2015, 06:36:13 pm »
Flash == MicroSD

Everything runs on the one, removable, MicroSD card.  If I end up needing more perf, the Odroid units have the option of running an even faster flash module "at the same time" (although only one of them gets the faster bus access)

Offline Otje

  • Full Member
  • ***
  • Posts: 214
  • Karma: +6/-1
Re: Hardware: What are you using to run openHAB?
« Reply #38 on: February 26, 2015, 06:41:02 pm »
Ok thanks for confirming, so we have a similar setup.
VERA Plus, VERA 3 Lite , couple of PIR's, several switch units, wall mounted tablet, Sonos integration with TTS, Temperature sensors, Imperihome, Zwave LED bulbs

Offline GoBruins

  • Newbie
  • *
  • Posts: 14
  • Karma: +2/-2
Re: Hardware: What are you using to run openHAB?
« Reply #39 on: February 26, 2015, 07:38:44 pm »
Everything runs on the one, removable, MicroSD card.  If I end up needing more perf, the Odroid units have the option of running an even faster flash module "at the same time" (although only one of them gets the faster bus access)

That is the route I went; namely, an eMMC card. It seems significantly faster than a MicroSD card.

- JIm

Offline a-lurker

  • Hero Member
  • *****
  • Posts: 866
  • Karma: +64/-8
Re: Hardware: What are you using to run openHAB?
« Reply #40 on: April 25, 2015, 05:57:50 pm »
Quote
I think most folks using the micro platforms are using them as Runtime only.  In this mode, they're mounting the remote FS and editing on their convention machines
Just on remote editing and updating. DropBox is another option:

https://github.com/openhab/openhab/wiki/Dropbox-IO

@Electron Employer:  Looks like the Cubieboard4 only consumes 12.5 Watts :)  Your electrons are working overtime at 30W.

Offline silencery

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +14/-1
Re: Hardware: What are you using to run openHAB?
« Reply #41 on: August 05, 2015, 03:22:08 pm »
I recently started on openHAB and have been testing on a full server. It's almost production-ready now, so I moved it to a Raspberry Pi 2.

The RPI 2 is usable, but too slow for my taste; rules which took milliseconds to process on the full server now take 2-3 seconds.

This is probably because our environment is fairly large. We have about 70 devices total with approximately 40 rules running a large variety of functions and bindings (Pushover, Nest, DSC, Plex, Astro, System Monitor, some custom stuff). Persistence is being handled by mysql on an external HDD, but I've also tested against RRD4J which was even worse in terms of performance.

I feel there's probably room for optimization, but I'm going to also experiment with some slightly better hardware (Odroid XU4) to see what the difference might be.

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Hardware: What are you using to run openHAB?
« Reply #42 on: August 06, 2015, 02:51:59 am »
@silencery,
I'd be interested in knowing more details about your config, esp when it comes to the performance elements (eg vmstat 5, or similar). 

I've not run on an RPi2 (yet) but I've seen a number of people have issues with the iops achievable via the SD Card interface on those devices.

That said, I have ~1000 items in my setup, most with RRD-based persistence.  The bulk of these are coming/proxied from my MiOS/UI5 system (Alarm, ZWave etc), but ~150 are coming from @watou's native Nest Binding, and there are ~ 100 coming from native Harmony, Astro, Weather MQTT Bindings.  Most of the time, this system is idle... very idle. 

I see bursts in my ODroid C1 System when it's RRD's are written, as well as when some of my custom Rules (for Energy calcs) kick in, but they're not impacting Scene timing (I have Debug level logging enabled, and I write timing data for each Rule executed)

If you go the ODroid route, it would be worthwhile picking up their eMMC module, and the battery for the on-board RTC.  I replaced the U1 SDCard with one of these, and the difference is noticeable (and the U1 MicroSD Card is also noticeable over a regular Class 10 MicroSD Card).

The XU4 looks like a nice module.

Offline silencery

  • Sr. Member
  • ****
  • Posts: 254
  • Karma: +14/-1
Re: Hardware: What are you using to run openHAB?
« Reply #43 on: August 06, 2015, 04:39:49 am »
1000 items? Wow :)

That's impressively huge AND you have debug logging on? Your IO must be taking a decent hit. That's very interesting info to share; it sounds like I do indeed have a lot of room for optimization.

Yes, I've been concerned about storage bottlenecking the RPI2, so I moved the root FS off SD onto a conventional HDD. Results are still the same, so it seems there's something else causing the performance hiccups. I've also taken care to watch the openHAB output to fix anything that may have been causing errors or warnings.

Here's a paste of the vmstat output. Everything seems to be ok. It's not even hitting the swap:

procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa
 1  0      0 344088 134824 283388    0    0     0     4  434  297  2  0 98  0
 0  0      0 344236 134824 283396    0    0     0    22  620  486  1  1 98  0
 1  0      0 343820 134828 283396    0    0     0     9  466  333  2  0 98  0
 0  0      0 344216 134828 283404    0    0     0     4  647  500  2  1 98  0
 0  0      0 343712 134828 283416    0    0     0     4  468  323  3  0 96  0
 0  0      0 344020 134828 283424    0    0     0     4  618  482  2  0 98  0
 0  0      0 343924 134828 283424    0    0     0     4  450  307  2  0 98  0
 0  0      0 344176 134828 283432    0    0     0     8  622  484  1  1 98  0
 0  0      0 344044 134828 283432    0    0     0    19  445  320  2  0 98  0
 4  0      0 344288 134828 283440    0    0     0     5  585  441  2  1 97  0
 0  0      0 343884 134832 283436    0    0     0     4  516  374  2  0 98  0
 3  0      0 343872 134832 283448    0    0     0     4  450  307  2  0 98  0
 0  0      0 344068 134832 283456    0    0     0    14  773  590  5  1 95  0
 1  0      0 343712 134832 283456    0    0     0     7  444  309  1  0 98  0

I should say the slow triggers are not consistent; sometimes things happen quickly, sometimes they take forever. I thought it was just an issue of the objects not being cached in memory yet, but the slowness happens even if the server has been running for a while. I'll need to find some time to trace.

The sluggishness comes up in various areas, but one example is a rule I setup to dim the lights when a movie is playing on the Plex client. The associated actions are pretty simple: evaluate if it's day/night. send a notification to plex via json, and dim the lights if a movie is playing during the evening. When i fire the trigger (start or resume a movie), this action can take anywhere from near instantaneous to 5-6 seconds to complete. Odd.

By the way, your suggestion for adding locks on shared objects in the other thread was awesome. It really helped enhance consistency by quite a bit. Now I just gotta focus on performance.

Thanks!

Offline guessed

  • Moderator
  • Master Member
  • *****
  • Posts: 5301
  • Karma: +92/-22
  • Release compat is not a bolted-on afterthought
Re: Hardware: What are you using to run openHAB?
« Reply #44 on: August 09, 2015, 02:59:13 pm »
@ silencery
1000 items? Wow :)
Actually it's not that much, a Vera Device expands to ~10-15 Items in openHAB so the #'s rack-up quickly ;)

Here's what mine looks like when the system is just ticking along:
Code: [Select]
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0 101368 140900 285164    0    0     0  1664 9501 3803  4  4 88  3  0
 0  0      0 101496 140900 285164    0    0     0    21 8349  547  0  0 99  0  0
 0  0      0 101504 140900 285164    0    0     0     1 8307  451  0  0 100  0  0
 0  0      0 101472 140900 285164    0    0     0     0 8312  447  0  0 100  0  0
 0  0      0 101472 140900 285164    0    0     0    31 8313  463  0  0 100  0  0
 0  0      0 101440 140900 285164    0    0     0     2 8323  461  0  0 100  0  0
 0  0      0 101496 140900 285164    0    0     0     0 8334  463  1  0 99  0  0
 0  0      0 101000 140900 285176    0    0     0     0 8340  468  5  0 95  0  0
 0  0      0 101224 140900 285176    0    0     0     3 8337  487  1  0 99  0  0
 0  0      0 101232 140900 285176    0    0     0     0 8322  468  0  0 100  0  0
 0  0      0 101200 140900 285176    0    0     0     0 8345  490  0  0 100  0  0
 0  0      0 101200 140900 285180    0    0     0     3 8315  461  0  0 99  0  0
 0  0      0 100772 140908 285180    0    0     0  1671 9385 3484  4  5 88  4  0
 0  0      0 100860 140908 285180    0    0     0    25 8333  510  0  0 99  1  0
 0  0      0 100836 140908 285180    0    0     0     5 8310  454  0  0 100  0  0
 0  0      0 100836 140908 285180    0    0     0     0 8460  811  0  0 99  0  0

Of course, during the busy times it looks a lot different.  The largish figures under Blocks Out are the RRD Sync, which is set to write each minute, in addition to each-change.  Looking at the Wait stat, it only has a small impact on the system during that time.

For my logging, I have DEBUG enabled with both Local FS and SYSLOG as output.  The latter is another RPi where I centralize all my device logs, and it's on an Attached USB Drive where I offline/archive logs for months (Router, openHAB, Mac, etc, etc).  In the worst case, I could turn off openHAB's DEBUG Logging and I've have a copy on the other machine.


Your #'s aren't anything to worry about, so I'd expect the blockage to be somewhere else.  It would be worthwhile double-checkin the locks you've added to ensure they're tightly scoped around "just" the bit that needs the consistency lock.  I'd also look at those rules and create distinct locks for the bits that need them, just incase there's any unneeded sharing going on.

Slow Rule executions will occur on the first time each Rule is executed after Startup (or after a Rule has been edited, causing a Reload).  These timings are often large, even in fast-CPU environments and don't seem to be avoidable, but they're [largely] a one-time cost - unless you're hot editing Rules frequently.

It may also be that your VMStat #'s are quite different during Scene execution, so you may want to create a script to gather the logs over a longer period so they can be looked at in more detail.

Quote
I've also taken care to watch the openHAB output to fix anything that may have been causing errors or warnings.
Definitely good practice... esp after you've just written any new Rules ;)

I put timing hooks into quite a few of my scenes, which allows me to go back and see if there are long-running things "after the fact".

The typical form of these is:

Code: [Select]
rule "..."
when
    ...
then
    var t = now

    ...
    var long x = now.getMillis - t.getMillis
    logInfo("eagle", "PERF Pull-Data-from-Eagle elapsed: " + String::valueOf(x) + "ms")
end

These have come in VERY handy for all sorts of issues.


The other thing I changed a lot of is my use of "Item... received update ..." in Rules.  I've converted almost all of these to use "Item ... changed" or "Item ... changed to ...".

I used to put all the logic in the Rule itself, and going this route has helped a bunch (as the System is now doing the comparisons, instead of the Rule itself)