Raspberry Pi 3B+ - Performance

If this is a noddy question I apologise in advance.

I have a Pi 3B+, I have installed a USB Hard Disk so that I don’t wear out the SD card. I have installed a powered USB hub to ensure the hard disk gets enough juice, as I hear the USB ports are a bit marginal.

I am also driving the WiFi, and a SonOff USB Generic Zigbee 3 gateway. That’s it. Nothing else.

The system runs fine, I’m running containerised Docker HA, with containerised MQTT and Z2M. All seems ok… However, it pauses… it runs fi…ne… then… it pau…ses. I can be editing the configuration.yaml in vi and it will pause every 5th key press.

I have some circumstantial evidence it might be related to Z2M, but nothing I would say in concrete. If I run “top”, see below. I note swap is quite high, but we still have free space and I’d not want it to live on HDD swap. Does this sound like the “nature of the beast” or do I have a problem?

top - 21:43:47 up 5 days, 23:01,  3 users,  load average: 1.39, 1.47, 1.36
Tasks: 165 total,   1 running, 164 sleeping,   0 stopped,   0 zombie
%Cpu(s):  7.4 us,  7.7 sy,  0.0 ni, 84.1 id,  0.8 wa,  0.0 hi,  0.1 si,  0.0 st
MiB Mem :    923.2 total,     32.7 free,    294.0 used,    596.6 buff/cache
MiB Swap:    100.0 total,      8.6 free,     91.4 used.    521.1 avail Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
 3878 root      20   0  308152 202568  28716 S   9.9  21.4   1108:12 python3
  456 root      20   0   68452   5684   4728 S   4.9   0.6 383:54.92 NetworkManager
  113 root      20   0   35508   5384   4964 S   3.3   0.6 299:35.49 systemd-journal
  518 root      20   0    3036   1808   1496 D   3.3   0.2 242:12.99 dhcpcd
10066 root      20   0       0      0      0 I   2.0   0.0   0:07.27 kworker/1:1-events
  444 root      20   0   25504   2972   2060 S   1.6   0.3 129:41.67 rsyslogd
23819 root      20   0       0      0      0 I   1.6   0.0   0:04.76 kworker/3:1-events
16960 root      20   0       0      0      0 I   1.3   0.0   0:01.93 kworker/0:0-events
  448 message+  20   0    6972   2688   2048 S   1.0   0.3  81:38.51 dbus-daemon
19404 pi        20   0   10420   3044   2508 R   0.7   0.3   0:01.14 top
   12 root      20   0       0      0      0 I   0.3   0.0  21:19.58 rcu_sched
   92 root      20   0       0      0      0 S   0.3   0.0   1:11.73 jbd2/sda1-8
 8548 root      20   0       0      0      0 I   0.3   0.0   0:00.98 kworker/u8:1-brcmf_wq/mmc1:0001:1
    1 root      20   0   33848   5128   3876 S   0.0   0.5   0:20.15 systemd
    2 root      20   0       0      0      0 S   0.0   0.0   0:01.21 kthreadd
    3 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_gp
    4 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 rcu_par_gp
    8 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 mm_percpu_wq
    9 root      20   0       0      0      0 S   0.0   0.0   0:00.00 rcu_tasks_rude_
   10 root      20   0       0      0      0 S   0.0   0.0   0:00.00 rcu_tasks_trace
   11 root      20   0       0      0      0 S   0.0   0.0   1:15.82 ksoftirqd/0
   13 root      rt   0       0      0      0 S   0.0   0.0   0:00.58 migration/0
   14 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/0
   15 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/1
   16 root      rt   0       0      0      0 S   0.0   0.0   0:00.37 migration/1
   17 root      20   0       0      0      0 S   0.0   0.0   1:25.51 ksoftirqd/1
   20 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/2
   21 root      rt   0       0      0      0 S   0.0   0.0   0:00.37 migration/2
   22 root      20   0       0      0      0 S   0.0   0.0   1:09.42 ksoftirqd/2
   25 root      20   0       0      0      0 S   0.0   0.0   0:00.00 cpuhp/3
   26 root      rt   0       0      0      0 S   0.0   0.0   0:00.38 migration/3
   27 root      20   0       0      0      0 S   0.0   0.0   1:05.25 ksoftirqd/3
   30 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kdevtmpfs
   31 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 netns
   34 root      20   0       0      0      0 S   0.0   0.0   0:00.00 kauditd
   36 root      20   0       0      0      0 S   0.0   0.0   0:01.08 khungtaskd
   37 root      20   0       0      0      0 S   0.0   0.0   0:00.00 oom_reaper
   38 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 writeback
   39 root      20   0       0      0      0 S   0.0   0.0   1:37.72 kcompactd0
   57 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 kblockd
   58 root       0 -20       0      0      0 I   0.0   0.0   0:00.00 blkcg_punt_bio
   59 root     -51   0       0      0      0 S   0.0   0.0   0:00.00 watchdogd
   61 root       0 -20       0      0      0 I   0.0   0.0   0:18.45 kworker/2:1H-kbloc

You really don’t want to run wifi as your network connection in ha. I can’t blame it for your pauses, but it is not the best.

Take a look at dmesg.

I would like to use HA on rPi.

  • Did your resolve / improve performance?
  • Did you install HA OS? or some other variation?

You haven’t provided much detail. I believe minimum requirement is rpi 3b+ which is what I use. This runs perfectly fine but would ultimately depend on how you use it.

My main install is using VM on Windows and the rpi is a backup copy running in parallel. If you look at historical data it takes longer to load but otherwise it’s ok.

You need to use ethernet and best to install software to a usb drive. Cards seem to fail eventually and it’s happened to me.

And software gets more complex over time, and bigger and more demanding. I think a pi4 would be about the minimum I would want to try these days.

If you have a spare 3b lying around, by all means try HA - no expenditure needed to try things out. But don’t buy one specially.

Hi,
It’s running happily enough, you don’t need sparkling performance from a remote controller. I also have Plex and zigbee2mqtt on mine, along with the MQTT server. That’s the advantage of the Containerised docker solution, would I go this way if I had a fresh start? That’s an interesting question. The managed solution has some advantages over the containerised, but I’m not sure I’d be able to run the likes of the Plex server on the same host. I noted the performance of my Pi was MUCH worse when I was using WiFi, I have now gone to some lengths to disable the wifi on the Pi and I only use cable ethernet.

I also ported the OS to hard drive, rather than an SSD as in this application it’s running 24/7. An SSD will wear out, a hard drive won’t. (Make sure to look into the power supply issues with HD and the limited power from the Pi, you need to help it with power to the USB bus to avoid intermittent issues when under load.). It’s an added layer of complexity though, that is my real observation with the Pi. Complexity…

The audio output of the Pi is also weedy, so if you plan to use the audio subsystem to drive speakers direct, you’ll need powered speakers.

If you have one and it lacks a job, yeah it works. Will you end up continually trying to work out how to do the next minor tweak… yup. Even down to backups… It runs on very little power, when it’s in a big metal box it runs fairly cool and mine doesn’t have a fan, but I live in Scotland so it’s not exactly warm. Plex does eat your RAM, but they do cohabit.

Personally, if I was starting again I’d be looking to see if there was an easier less fiddly alternative that allowed me to run HA OS, and install Plex Server, Z2M, MQTT on the same device. However, yes it works… to a point.

Ponder what you want to do in the bigger picture before you spend money.

Rob

1 Like

I appreciate the responses to my post. My details are posted at: Will rPi 3B+ or 4 be enough to control thermostats?

I have several 3B+ devices collecting dust, so I thought it might make sense to use one to replace the AMD box and use less energy. It’s really hot in the summer, so a cool 3B+ is appealing. I also would like to repurpose the AMD box for OnlyOffice

I suspect that the 3B+ CPUs are more than enough and that the bottleneck is RAM. I recently had a good success with another 3B+ outfitted with NextCloudPi on a USB 2T SSD. Really nice that the 3B+ is configured out of the box for USB booting.

Only that a RK3566 based device is more performant and much more energy efficient (baseline only around 1W compared to 3-4W for the RPi 4).

Buying a new RPi 4 in the end of 2023 wouldn’t be the smartest move IMHO.

Ether go with the green for a complete package and support nabu casa & HA

Or pay half and don’t support HA