Wireguard on Pi Zero Benchmarked

Tl;dr - I tested the throughput of a Pi Zero running PiVPN (Wireguard) and found that even two devices streaming a 1080p YouTube stream was stable and did not encounter any buffering.

Pi Zero Setup Process

I will be using a Raspberry Pi Zero W running 32bit Raspberry Pi OS straight from Raspberry Pi Imager v2.6 installed onto a MicroCenter 32GB mSD card. The only applications installed will be speedtest-cli and PiVPN. Power will be provided from an Anker cable getting power from a Samsung wall adapter so I don't suspect power delivery will impact performance.

Wireless will be provided from a UniFi AP-AC-PRO running the latest firmware sitting about 4-5 feet away. Everything inside my home network is on Cat6a with a 1Gbps WAN uplink to try and rule out any other interference.

Testing Method

To load test this Pi Zero my plan is to start with a single client device and stream a YouTube video at 1080p. If the server remains stable I will add another device with a second 1080p YouTube stream. I intend on adding one device at a time until 4 devices are connected, all the while checking for stability in-between client additions. I suspect, that is a single Raspberry Pi Zero can host four simultaneous 1080p video streams it just might be an acceptable experience. I mean at the end of the day I just want to know what a $7 USD from MicroCenter can do.

Baseline Performance

  • 25ms - 28Mbps UP - 6.7Mbps DOWN
  • 15ms - 29Mbps UP - 14.5Mbps DOWN
  • 14ms - 23Mbps UP - 14.6Mbps DOWN
  • 17ms - 26Mbps UP - 15Mbps DOWN
    Examining the information above we should be expecting on average 27 Mbps upload and only 12.7 Mbps download.


Load Testing

Device One Connected


The first device connected was my wife’s Razer Blade 15 and of course we had to run the speedtest you see above. If you compare these numbers to the baseline, the latency has improved! I think that is crazy since the Raspberry Pi has not moved and the network environment has not changed a bit. Now, the upload and download speeds being only 8.6 Mbps and 7.8 Mbps respectively is acceptable. Its not great but keep in mind your network is as slow as your slowest link. Considering we are trying to put a 1GHz ARM processor in the way I find these speeds to be okay. Especially if we are just trying to stream a video. Now we will start a 1080p YouTube stream on the first device.

Here is a speedtest from Client 1 while connected…


Device Two Connected

As expected, the Pi Zero was handling this workload rather well, so I suspect it is time to connect a second client. The second device was my personal phone. Once connected I fired up an Episode of THE WAN SHOW that was about 2 hours long and the quality automatically set for 1080p HD. This is great news! Some time past and my phone was able to successfully maintain the YouTube stream. This is when I got curious and broke the scientific protocol I had been carefully following up to this point. I decided to try and download a Ubuntu Desktop ISO onto the first connected client. Oh man! This was super slow to initiate the download. I figured it would fail but to my surprise after about 5 minutes it actually started to trickle along. This image below is from htop with both YouTube streams AND the Ubuntu ISO download.

Device Three Connected

Now that I have gotten this interesting screenshot and the Pi Zero was stable, I added a third device. I bugged the wife for her cell phone and got her connected. I asked her to listen to some YouTube with the quality turned all the way up to 1080p while she did homework. Now with this third device, YouTube automatically selected 720p but that was outside the scope of what I wanted to test. We had to go into advanced and set the quality to 1080p. That is okay, the Pi Zero handled this fine with about 1.5 seconds of buffering right at the beginning. We will revisit her and ask about her experience a little later…. However I continued to watch htop and while the CPU utilization was high it remained stable. At this point I am amazed at what this little thing can do!

Device Four Connected

The Pi Zero was stable at three devices, so now we need to add yet another device. Into the old phone box I go, looking for my wife’s old Samsung S9. Exactly the same protocol as earlier, pick an episode of The WAN Show and force the quality to 1080p. This time, the Galaxy S9 auto selected 480p. In my experience this the client understanding that the network might be degraded and unable to push the full stream. This time it buffered for about 6 to 7 seconds but for almost 20 minutes ran that video perfectly fine. This is great news. I’m starting to suspect that the Pi Zero might be a valid home VPN endpoint for those edge case users that want a super cheap was to access their home network…

Can I Crash It???

By no means am I an expert in load testing network components let alone anything for that matter. But what I do know how to do it download things. Client 1 has a 2GB ISO queued up and ready to download. Client 2 has 5 applications that could be updated. Client 3 has 12 applications available for download, and Client 4 has 26 applications available for updates. I am going to start all 4 download streams at the same time.

I think the answer is yes, we can “break it” but no how you would suspect. Since we had no quality of service in place nor did we have any traffic shaping the ISO download took priority. None of the other applications could update from the Google Play Store while that other stream was running. Now this is where it gets a bit interesting. Even after I cancelled the ISO download and disconnected from the VPN, the other clients continued to experience issues where there was no throughput. After disconnecting and reconnecting to VPN on each client we were able to get data throughput again. All the while we can keep in mind that the Pi Zero never got stuck at 100% utilization and the software was stable enough it never crashed. So I would say, yes we can cause impact to others but no we cannot break it per say.

Conclusion

Yes, a Raspberry Pi Zero could reasonably host a small scale VPN server for one or two clients as long as the WAN uplinks for those clients is rather speedy. We must keep in mind that your speeds are limited to your slowest interface in the data path. So even if we could push 10 Mbps upload and 20 Mbps download from the server, if we are traveling with a 5 Mbps up/down connection we would likely see speeds much less than 5 Mbps which would be borderline acceptable for only a single device. Which brings me to the statement, your mileage may vary. But overall YES you could potentially deploy a Raspberry Pi Zero at Grandma’s house in Canada and stream Netflix from her house while living in the United States.
4 Likes

As a new user I can only embed two images in my post, so since I posted speedtest screenshots in the OP, here are the screenshots with captions from htop

Pi Zero Idle

Pi Zero - Two Clients Connected - Two 1080p YouTube Streams

Neat write up is on my personal blog which the link can be found on my profile.

1 Like

Pi Zero - Two Clients - Two 1080p YouTube Streams + Ubuntu ISO Download

Pi Zero - Four Clients - Four 1080p YouTube Streams

1 Like