In this article, we are going to set up a speed test to compare WireGuard vs OpenVPN. WireGuard and OpenVPN can both be used allow for a user to connect to their home network from a remote location. This is incredibly useful because it allows you to connect to your storage server from anywhere in the world, and it ensures you have a secure connection even from an untrusted network.
WireGuard and OpenVPN are both VPN standards, but they differ in their implementations. WireGuard was originally written as a mathematical proof in order to be as fast as possible. The code base of WireGuard is 1/10th the size of that of OpenVPN. As a result, the performance you see will vary depending on which one you use.
Speed Test Setup
I set up a test to compare the performance between WireGuard and OpenVPN from a theoretical maximum perspective. The test was hosted on the 1GB RaspberryPi4 (with cooling fans) using PiVPN Project.
I completed the speed tests using a segmented network, and I took measurements using Black Magic Speed Test. I recorded read and write speeds for both OpenVPN and WireGuard.
Both configurations were set up using the default PiVPN settings. Check out these videos for details on this setup:
Performance Comparison Results
|OpenVPN||15.0 (MB/s)||18.0 (MB/s)|
|WireGuard||40.2 (MB/s)||52.8 (MB/s)|
Between the two possible configurations, it is clear that WireGuard is by far the best option in terms of speed. WireGuard demonstrated read and write speeds of approximately three times those of OpenVPN.