r/WireGuard • u/sden • Dec 22 '19
Wireguard throughput on Raspberry Pi 4
I had a hard time finding results for Wireguard throughput on the Raspberry Pi 4 and how it behaves under sustained Wireguard load (ie. CPU temperature / throttling). Since I now have a Pi 4 (4GB), I can provide those results:
Test Details
Up to date Raspbian (apt full-upgrade)
Wireguard 0.0.20191219
Local 1Gbps LAN
The Pi4 has 3 heat sinks (no fan) and is in a mesh (very open) case.
Peered with a Xeon E5-2630 v3, Debian buster, Wireguard 0.0.20191012 VM
iperf v2
Results (10 runs)
Min: 806Mbps
Max: 857Mbps
Avg: 829 Mbps
Maximum observed CPU temperature on extended consecutive runs: 71C.
Performance is similar whether using the onboard 1gbps NIC or using a USB3 to gigabit RJ-45 adapter
0 instances of throttling occurred during testing
For the sake of search engines I'll say bandwidth and speed here... Happy to answer any questions.
9
u/ChunkyBezel Feb 05 '20
Just thought I'd add a comment here instead of starting a new post on a similar subject.
I just ran a Wireguard performance test between a pair of older Raspberry Pi 2's, to see if they were capable of running close to the 100Mbps wire speed. Maybe still useful if you want to run a VPN over a home broadband connection that isn't as fast as 100Mbps.
2x Raspberry Pi 2 v1.1 at stock clock speeds.
Ubuntu 19.10.1
Wireguard 0.0.20190913
iperf3
Plain non-VPN speed:
root@rpi2-01:/etc/wireguard# iperf3 -c 10.0.0.11
Connecting to host 10.0.0.11, port 5201
[ 5] local 10.0.0.10 port 45484 connected to 10.0.0.11 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 11.5 MBytes 96.2 Mbits/sec 0 120 KBytes
[ 5] 1.00-2.00 sec 11.2 MBytes 94.4 Mbits/sec 0 120 KBytes
[ 5] 2.00-3.00 sec 11.2 MBytes 93.8 Mbits/sec 0 120 KBytes
[ 5] 3.00-4.00 sec 11.3 MBytes 94.9 Mbits/sec 0 120 KBytes
[ 5] 4.00-5.00 sec 11.1 MBytes 93.3 Mbits/sec 0 120 KBytes
[ 5] 5.00-6.00 sec 11.2 MBytes 94.4 Mbits/sec 0 120 KBytes
[ 5] 6.00-7.00 sec 11.2 MBytes 94.4 Mbits/sec 0 120 KBytes
[ 5] 7.00-8.00 sec 11.2 MBytes 93.8 Mbits/sec 0 120 KBytes
[ 5] 8.00-9.00 sec 11.2 MBytes 94.4 Mbits/sec 0 120 KBytes
[ 5] 9.00-10.00 sec 11.2 MBytes 94.3 Mbits/sec 0 120 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 113 MBytes 94.4 Mbits/sec 0 sender
[ 5] 0.00-10.01 sec 112 MBytes 94.1 Mbits/sec receiverWireguard speed:
root@rpi2-01:/etc/wireguard# iperf3 -c 192.168.255.2
Connecting to host 192.168.255.2, port 5201
[ 5] local 192.168.255.1 port 43046 connected to 192.168.255.2 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 10.8 MBytes 90.2 Mbits/sec 0 139 KBytes
[ 5] 1.00-2.00 sec 10.9 MBytes 91.0 Mbits/sec 0 195 KBytes
[ 5] 2.00-3.00 sec 10.6 MBytes 89.0 Mbits/sec 0 232 KBytes
[ 5] 3.00-4.00 sec 10.6 MBytes 89.0 Mbits/sec 0 234 KBytes
[ 5] 4.00-5.00 sec 10.6 MBytes 89.0 Mbits/sec 0 234 KBytes
[ 5] 5.00-6.00 sec 10.8 MBytes 90.5 Mbits/sec 0 277 KBytes
[ 5] 6.00-7.00 sec 10.9 MBytes 91.1 Mbits/sec 0 290 KBytes
[ 5] 7.00-8.00 sec 10.7 MBytes 90.0 Mbits/sec 0 290 KBytes
[ 5] 8.00-9.00 sec 10.6 MBytes 89.0 Mbits/sec 0 290 KBytes
[ 5] 9.00-10.00 sec 11.0 MBytes 92.6 Mbits/sec 0 405 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 107 MBytes 90.1 Mbits/sec 0 sender
[ 5] 0.00-10.01 sec 106 MBytes 89.1 Mbits/sec receiverOnly a little slower than unencrypted.
1
u/drauzinho Dec 26 '19
How can I update my WireGuard to the 0.0.20191219 version ? Mine shows 0.0.20191127-1, and even when I try apt update, apt-get update it shows nothing new.
BR, Drauzio.
1
1
u/PsYCr0 Jan 04 '20
Hello,
I have a similar setup installed since a couple of days but I am really struggling with the bandwith performance. Here is my setup:
WG-Server Side:
Unifi USG-PRO --> 40 Port Unifi Switch--> Port 48 Cat 6 Cable connected to WG-GW (RPi4)
speedtest on that RPi4 has currently:
Latency: 0.45 ms (0.23 ms jitter)
Download: 812.74 Mbps (data used: 729.0 MB)
Upload: 710.67 Mbps (data used: 654.9 MB)
Packet Loss: 0.0%
When I connect from my MBP from home (ISP 500Mbit down/50MBit up) I can only reach this results:
Latency: 9.11 ms (7.07 ms jitter)
Download: 159.94 Mbps (data used: 237.6 MB)
Upload: 34.83 Mbps (data used: 33.3 MB)
Packet Loss: 0.4%
Any ideas what might cause such difference? The installation I followed was from https://www.reddit.com/r/pihole/comments/bnihyz/guide_how_to_install_wireguard_on_a_raspberry_pi/
My expectation was that I nearly reach my 500Mbit down as remote site has 710,67 Mbps! Followed also top and glances performance of the PI and its nearly idle :)
3
u/sden Jan 04 '20
I described a similar experience here. The solution was to set these two sysctl parameters on all nodes:
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
1
u/PsYCr0 Jan 04 '20
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
with all nodes you mean on the rpi4 in /etc/sysctl.conf? I did this but still not full bandwith on my macbook pro over WG
1
u/Gullible_Bullfrog294 Dec 23 '25
Hi would you by any chance have a guide on how you set this up. I have the UCG Ultra as the Router and want to use my LI5 as a VPN gateway with Mullvad.
Much appreciated thanks.
3
u/emelbard Dec 23 '19
I see similar in a road warrior scenario with traffic piped back to a RPi 4 with a 1G connection. No difference in latency or throughput with or without WG. It's like magic
1
u/jerkfacebeaversucks Dec 24 '19
Well that's quite good! Nothing wrong with those speeds at all.
What kind of CPU usage was that level of traffic producing?
1
1
u/damn_the_bad_luck May 02 '22
Somebody needs to test that over a really fast ISP connection, to a remote vpn server on the Internet, preferably to a popular vpn service like Mullvad.
Testing to a local machine isn't the same as real life usage. I am curious though, would be good to see.
1
Jul 30 '22
[removed] — view removed comment
1
u/damn_the_bad_luck Jul 30 '22
Thanks for that link. Very interesting, indeed.
His conclusion isn't very brilliant though. Complaining wireguard single threaded, well, no shit, same for openvpn and anything else. In fact, pfsense struggles performance wise for the same reason. At least Linux is optimized to let wireguard hog one thread, while running other linux processes on other threads. pfsense isn't optimized to utilize multi-core cpu's, not like linux anyways.
→ More replies (2)
1
-1
u/ACER719x Dec 23 '19
Was this using encryption or no encryption? I find this hard to believe if the Raspi 4 doesn't have CPu crypto Extensions.
3
u/sden Dec 23 '19
This is encrypted traffic using the strong / secure (peer reviewed) default ciphers. If you're coming from an IPsec background the performance isn't going to seem possible / plausible -- but that's part of the reason Wireguard is getting so much attention.
1
u/TrevorSpartacus Dec 23 '19
I'm not sure how you would disable encryption in wireguard and it doesn't use hw crypto acceleration anyway.
1
u/jerkfacebeaversucks Dec 24 '19
it doesn't use hw crypto acceleration anyway.
TIL. <<does some reading>> Doesn't use AES. Well that's interesting. Thank you.
0
Dec 23 '19
[deleted]
2
u/sden Dec 23 '19
I've setup Wireguard on Vultr and Upcloud VPSes. Wireguard on any device I've tried can saturate my Internet pipe (150/30 Mbps). I have tested a high speed link between data centers in Chicago that have 1Gbps links and Wireguard is basically line speed (full gigabit) but those are x86 VMs.
0
Dec 23 '19
[deleted]
1
u/sden Dec 23 '19
Curiously it's about 2 cores (200%) out of 4. I've seen this on 4 core x86 vms too (not fully cpu bound) -- even on 40gbit connections.
2
u/bb147 Apr 10 '20
i Know this post is 3 months ago but it came up on Google. Are you able to tell me your ram usage? I'm deciding between the 2gb or 4gb model. Only looking to run pivpn with wireguard, and pi-hole with apache.