Please login or register.

Login with username, password and session length

Author Topic: Improving the PiX10Hubs performance.  (Read 7167 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Improving the PiX10Hubs performance.
« on: January 15, 2020, 06:18:57 PM »

I started a thread in the Homegenie.club forum Asking: How users have improved the performance of HG?
While waiting for some answers I did a bit of research and testing on my own.
What I found is a lot can be done to the PI OS  and other things which made me think users of the PiX10Hub could benefit from my findings.
I believe there are loads of things you can do to speed things up. These are a few that worked for me.
However prior to doing these make sure your SD card is a fast class 10 not a slow class 2

In HomeGenie:
1:Disabling logging and only use that when needed.
2:Disable and remove any program not in use or needed.
3:Flush you modules to remove thouse you may have tried but removed from groups.
4:Delete the X10securityRF file, this will get regenerated with x10 rf which you only use now.
5: Disable & remove (if possible) interfaces not in use.
6: Don’t use backgrounds for your groups.
7: keep groups small (don't have all modules in one group)
8: purge log files
I’m sure there are more things you can do in HG and will add to this as I try them if I notice any improvement.
Improving HA-Bridge:
1:Be sure it is up to date if you use this for Alexa.
2:disable logging and only enable it when trouble shooting
3: in the bridge control tab scroll down to UPNP send delay and decrease its value I've set mine to 450 from the 650 default.
As for things other then in HG & HA-Bridge on a Pi
1:Run htop and stop anything that is running and isn’t required.
In the raspi-config
1:disable the desktop if loading
2: In advanced settings make sure you have expanded the file system.
3: make sure your memory split for the GPU is set to 16
Outside raspi-config
1: clean up left over files from upgrades and package installs
sudo apt-get clean && sudo sudo apt-get autoremove -y (my tuicemen tools includes this)
2: free up unused memory (my tuicemen tools includes this)
sudo sysctl vm.drop_caches=1 && sudo sysctl vm.drop_caches=2 && sudo sysctl vm.drop_caches=3 && sync
3: if your still running Stretch consider upgrading to Buster (it realy is faster)
4: Pi boards are low power devices and anything additional plugged into it can be stealing power so we need to limit those things A pi Zero W only has one USb port unless you add a header or multiport. I found there is a way to turn off the power going to the HDMI port If your running headless you don’t need that.
5: Do an sudo apt update and sudo apt upgrade regularly newer drivers usually work better and faster and do #1 afterwards.
6: Consider using a USB stick or USB SSD I doubt a SSD will be any better then a stick as it is limited to the speed a USB port can supply. However Petediscrete may go into the way he done it(not sure if he is using a ZeroW with the SSD) you'd need extra USB Ports to do this and a virgin Zero W doesn't have any extras.
Here’s how you would do a USB stick (testing this now)
http://oskarhane.com/basic-raspberry-pi-setup-with-raspbian/
 >!

« Last Edit: March 07, 2020, 02:10:18 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Improving the PiX10Hubs performance.
« Reply #1 on: January 16, 2020, 06:18:03 PM »

So to day I was at Costco and seen a two pack of Scandisk 64gig USB 3 pen drives for dirt cheep (I thought) Since reading running from a USB drive will improve things I decided to grab them and test things out.
One of my ZeroW boards has the added full sized USB ports.  Since they aren't USB 3 ports I won't get the full advantaged of the pen drives. How much of a improvement will take a bit of time to see but I can state it is working. I'm running off one of the USB sticks.
I noticed after I created the USB disk that according to TomsHardware.com you can now setup any PI to boot directly from a USB drive with no SD card ever needed again (I assume this requires Buster).
So depending on how things go that may be my next trial.
https://www.tomshardware.com/news/boot-raspberry-pi-from-usb,39782.html
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Improving the PiX10Hubs performance.
« Reply #2 on: January 16, 2020, 08:39:02 PM »

So to day I was at Costco and seen a two pack of Scandisk 64gig USB 3 pen drives for dirt cheep (I thought) Since reading running from a USB drive will improve things I decided to grab them and test things out.
One of my ZeroW boards has the added full sized USB ports.  Since they aren't USB 3 ports I won't get the full advantaged of the pen drives. How much of a improvement will take a bit of time to see but I can state it is working. I'm running off one of the USB sticks.
I noticed after I created the USB disk that according to TomsHardware.com you can now setup any PI to boot directly from a USB drive with no SD card ever needed again (I assume this requires Buster).
So depending on how things go that may be my next trial.
https://www.tomshardware.com/news/boot-raspberry-pi-from-usb,39782.html

As both the SD card and the USB pen drive both use the same technology the fail rate for either is much the same. The fact that you are using a USB 2.0 interface you will probably see a slight drop in performance v the SD Card. The real advantage doesn't kick in unless your USB 3.0 pen drive is plugged into a USB 3.0 port, obviously not possible on a Pi Zero but possible on a Pi 4 with boot mods. A bit messy in its current format

The only real advantage in changing storage options on a Pi Zero would be using an SSD drive on the Pi Zero and that is purely for protecting against a low failure rate of the storage device. That's what I use on all my Pi's. Once the Pi 4+ is released this year which allows auto booting from USB the optimal storage device to use will be the SSD attached to its USB 3.0 port. Otherwise it's a bit of a novelty having your Raspbian/HG setup on a USB stick. Do bear in mind that you will have another dongle hanging off your Pi Zero with no performance gain.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Improving the PiX10Hubs performance.
« Reply #3 on: January 16, 2020, 08:47:25 PM »

Here's the SSD drives I use coupled with a USB to Esata cable. https://business.currys.co.uk/catalogue/item/P259910P?from=category
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Improving the PiX10Hubs performance.
« Reply #4 on: January 17, 2020, 07:57:16 AM »

Quote from: petera link=topic=31184.msg184115#msg184115

As both the SD card and the USB pen drive both use the same technology the fail rate for either is much the same. The fact that you are using a USB 2.0 interface you will probably see a slight drop in performance v the SD Card. The real advantage doesn't kick in unless your USB 3.0 pen drive is plugged into a USB 3.0 port, obviously not possible on a Pi Zero but possible on a Pi 4 with boot mods. A bit messy in its current format

The only real advantage in changing storage options on a Pi Zero would be using an SSD drive on the Pi Zero and that is purely for protecting against a low failure rate of the storage device. That's what I use on all my Pi's. Once the Pi 4+ is released this year which allows auto booting from USB the optimal storage device to use will be the SSD attached to its USB 3.0 port. Otherwise it's a bit of a novelty having your Raspbian/HG setup on a USB stick. Do bear in mind that you will have another dongle hanging off your Pi Zero with no performance gain.
From all the bench tests and other articles I've seen there is an advantage of using a USB thumb drive over a SD card. However first hand tests can prove other wise. These were only picked up for testing, I have other uses for them. Idefinately wouldn't want these pen drives sticking out from my CM15A however a mini would be fine.
I've already noticed a slight improvement in read & write speeds. To get real accurate  testing comparisons should be done with same size and brands. Most tests I seen and what I'm trying isn't. I don't  doubt a SSD drive is the route to go for best performance and worry free operation.  My old mini pc running Bullseye has a SSD drive and it is lightening fast. I doubt a pi 4+ with a SSD drive could come close to it performance wise and it was cheaper then a pi 4.

I'm sure other users may be interested in your SSD setups. Were they done simular to setting up a USB stick?
Have you tried the boot from USB method  on your other Pis mentioned in the TomsHardware article? I've not tested that yet.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Improving the PiX10Hubs performance.
« Reply #5 on: January 17, 2020, 09:14:44 AM »

The short answer is the USB 2.0 port is running off the Ethernet bus so you can figure out that the sharing of traffic between the two resources will impact on read/write speeds while LAN traffic is working as is with any server, HG being no exception.

I use SSD on the Pi3+ purely for reliability purposes. It boots straight from the SSD on a "plug'n'go" basis and It was never intended for any performance gain. The Pi4 was never an option in its current configuration. Yes there is a workaround to have it boot via a boot loader on the SD card and straight to SSD for the O/S. Too messy by far.

The Pi4+ later in the year will have addressed the above issue and with a Pi SSD Hat the whole setup will look completely integrated without the need for additional power supply to power the SSD.

Meanwhile all you need to do is burn a Raspbian image to your SSD drive, plug it into your USB port and power up your Raspberry Pi3+ and your system boots straight out of the box. No adjustment to the bootloader required.

On my Rock64 with USB3 and 4Gb of memory I need to edit the bootloader before booting from USB3.0
Logged

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: Improving the PiX10Hubs performance.
« Reply #6 on: January 20, 2020, 05:40:41 PM »

The title of the OP is about performance and how to improve it with changes to your software setup.  You mention limiting/eliminating added components/dongles.  While I would agree that this can improve performance in the sense that it will reduce the draw on the 5v PSU (which in a lot of cases are going to be under powered) thus reducing crashes and mystery reboots/hangs it will not increase the speed of your system.  It is a good idea to have a robust enough PSU to power whatever you are running, but I would hesitate to add it to a thread strictly about performance when the people looking at this are going to be primarily novice at best with the RPi.  It's definitely a valuable thing to consider though.

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Improving the PiX10Hubs performance.
« Reply #7 on: March 06, 2020, 03:43:43 PM »

  While I would agree that this can improve performance in the sense that it will reduce the draw on the 5v PSU (which in a lot of cases are going to be under powered) thus reducing crashes and mystery reboots/hangs it will not increase the speed of your system.  It is a good idea to have a robust enough PSU to power whatever you are running, but I would hesitate to add it to a thread strictly about performance when the people looking at this are going to be primarily novice at best with the RPi.  It's definitely a valuable thing to consider though.
If you can avoid a crash or hang then I would consider it a increase in performance. I suspect most users here picked up a PI kit which included a PSU As many have indicated these aren't the most robust.

On another note I decided to do some speed tests of my own on my ZeroW with the USB hat attachment.
I wanted to compare some USB and SD read/write speeds on the Zero W to see what SD or USB drive I should be using for the best speed.
I test each drive with the HG and HA-Bridge.services stopped and used this command
Code: [Select]
dd if=/dev/zero of=/tmp/out bs=1M count=400 posted here:
http://zeroset.mnim.org/2012/10/03/move-an-existing-raspbian-installation-from-memory-sd-card-to-usb-flash-drive-stick/
I have a few USB sticks as well as different SD cards so I'll post some of my findings when done.
« Last Edit: March 07, 2020, 12:35:59 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

bkenobi

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 24
  • Posts: 2082
Re: Improving the PiX10Hubs performance.
« Reply #8 on: March 07, 2020, 11:40:26 AM »

Other than during load time, I'm not sure how usb vs sd speed will make much difference for performance of HG or any other software discussed here running on an RPi. The primary thing that will affect performance is processor here.  There is no limitation from memory and there is no issue with storage IO.

I'll say it again...if you want a faster HG on your RPi, just get a faster RPi.  The RPiZW is an old boat anchor compared to the RPi3 and RPi4. No testing will change that.

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: Improving the PiX10Hubs performance.
« Reply #9 on: March 07, 2020, 12:21:12 PM »

The only reason I'm doing these tests with my zero w is because my Pi 3b+ has issues.
My zero W actually out performs my B3+ right now so I don't need a faster PI. The reason USB drives are included in my testing is because I can. What I'm more interested in is R/W speeds of the different cards and sticks I have to use. This will help me determine what is best to use here.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.