embarrassedmilk
Posts: 1
Joined: Mon Apr 27, 2020 12:11 pm

OpenVPN performance on Raspberry PI 4

Mon Apr 27, 2020 12:22 pm

Hi all,

Here's the deal - I want to use my RPi 4 as a torrent box (obviously, with VPN (I use ExpressVPN)), but I just don't seem to get enough speed out of it.

My setup is basically RPi 4 connected to an external drive with all meaningful stuff running on docker. haugene/docker-transmission-openvpn seemed like a good candidate, but all i got was lousy ~80 MBps. To verify my suspicion, I've pulled another docker image (raspbian/stretch), installed openvpn and speedtest there, and, indeed, with VPN it's ~80Mbps, without - ~250Mbps (with ~50% packets lost).

I gave an official client from ExpressVPN a shot (apparently they support Raspbian), but speed was even worse (~30Mbps). After I've reached out to their support, they basically shrugged and said that they don't have RPi atm to test it, but they might look into it at some point.

I thought that CPU might be a bottleneck, but CPU usage didn't even reach 20%, so I doubt that this is the case. I've seen posts where people explained that RPi 4 hardware doesn't support AES, but even without encryption speed remained the same.

My old setup is FreeNAS running on some old PC, which gives me great speed with Transmission and OpenVPN running in jail and I vaguely remember that in order to fix similar problem I set couple variables (don't remember why did they have to be exactly these values):

Code: Select all

kern.ipc.maxsockbuf=5242880
net.inet.udp.recvspace=4194304
When running OpenVPN on FreeNAS, i see following message:

Code: Select all

transmission openvpn[53761]: Socket Buffers: R=[4194304->524288] S=[9216->524288]
My current guess is that it has something to with buffer size, but for the life of me I can't figure out how to adjust it on Raspbian distro. When I start OpenVPN on RPi (both on docker and not), I see that socket buffers are somewhat smaller:

Code: Select all

Socket Buffers: R=[163840->327680] S=[163840->327680]
Changing sndbuf and rcvbuf values in openvpn config didn't seem to have any effect, and as far as I understood from documentation, it defaults to whatever value is set on OS level.

Sorry for the long post :) I hope that someone has seen this before and somehow fixed it. If someone is using another VPN provider and is able to achieve decent speed on their PI, i'm also curious, since I'm not really married to ExpressVPN.

mikeminish
Posts: 3
Joined: Thu Oct 11, 2018 7:17 pm

Re: OpenVPN performance on Raspberry PI 4

Fri May 08, 2020 7:27 pm

I would also like to know why ExpressVPN is so slow on my raspberry pi 3B+. I am using it as a WIFI-hotspot, and it normally gives me around 90mbps dowload speed, but around 7-10mbps with expressvpn connected.

audetto
Posts: 42
Joined: Fri Feb 28, 2014 8:44 pm

Re: OpenVPN performance on Raspberry PI 4

Sat May 09, 2020 11:16 am

mikeminish wrote:
Fri May 08, 2020 7:27 pm
I would also like to know why ExpressVPN is so slow on my raspberry pi 3B+. I am using it as a WIFI-hotspot, and it normally gives me around 90mbps dowload speed, but around 7-10mbps with expressvpn connected.
I have set up a wifi router using expressvpn and the download I get from a tablet is about 60 when I normally get 100.
So I cannot complain.

I found that on 5GHz the Pi AP works better and more reliably.

audetto
Posts: 42
Joined: Fri Feb 28, 2014 8:44 pm

Re: OpenVPN performance on Raspberry PI 4

Sat May 09, 2020 6:30 pm

mikeminish wrote:
Fri May 08, 2020 7:27 pm
I would also like to know why ExpressVPN is so slow on my raspberry pi 3B+. I am using it as a WIFI-hotspot, and it normally gives me around 90mbps dowload speed, but around 7-10mbps with expressvpn connected.
Before blaming the VPN provider or the Pi, what do you get on a Desktop PC?

I get 112 - 9 without and 86 - 5 with.

Return to “Troubleshooting”