Very slow download speed with OpenVPN tunnel on FreeBSD VPS

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
dcarmich
OpenVpn Newbie
Posts: 3
Joined: Tue Mar 01, 2016 7:42 pm

Very slow download speed with OpenVPN tunnel on FreeBSD VPS

Post by dcarmich » Wed Mar 02, 2016 2:53 pm

I have an OpenVPN tunnel set up on my FreeBSD 10.2 VPS, and when I try to use the tunnel from my iPhone the upload speed is within the 13-14Mbps range but the download speed has been very slow in the 0.25-0.41Mbps range.

(The original connection is a 55Mbps/16Mbps LTE connection.)

Here is the server configuration:

Code: Select all

local xxx.xxx.xxx.xxx
port 1194
proto udp
dev tun
script-security 2
up /usr/local/etc/openvpn/vpn-up.sh
down /usr/local/etc/openvpn/vpn-down.sh
ca ca.crt
cert server.crt
key server.key  # This file should be kept secret
dh dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 10.8.0.1"
keepalive 10 120
sndbuf 0
rcvbuf 0
push "sndbuf 393216"
push "rcvbuf 393216"
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
Here is the client configuration:

Code: Select all

client
dev tun
proto udp
remote xxxxxxxxxxx 1194
resolv-retry infinite
nobind
persist-key
persist-tun
mute-replay-warnings
ca ca.crt
cert dc_iPhone.crt
key dc_iPhone.key
remote-cert-tls server
verb 3
Would this be a configuration issue or an OS issue?

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: Very slow download speed with OpenVPN tunnel on FreeBSD

Post by Pippin » Wed Mar 02, 2016 11:46 pm

Hello,

Code: Select all

sndbuf 0
rcvbuf 0
push "sndbuf 393216"
push "rcvbuf 393216"
Try to set both to

Code: Select all

sndbuf 393216
rcvbuf 393216
push "sndbuf 393216"
push "rcvbuf 393216"
or

Code: Select all

sndbuf 0
rcvbuf 0
push "sndbuf 0"
push "rcvbuf 0"

dcarmich
OpenVpn Newbie
Posts: 3
Joined: Tue Mar 01, 2016 7:42 pm

Re: Very slow download speed with OpenVPN tunnel on FreeBSD

Post by dcarmich » Thu Mar 03, 2016 7:44 am

I tried setting sndbuf/rcvbuf to 0 and received an improvement in upload speed, but the same slow download speed.

Could it be an MTU/MSS issue?

dcarmich
OpenVpn Newbie
Posts: 3
Joined: Tue Mar 01, 2016 7:42 pm

Re: Very slow download speed with OpenVPN tunnel on FreeBSD

Post by dcarmich » Thu Mar 03, 2016 7:56 am

I tried sndbuf/rcvbuf at 0 as well as setting net.inet.udp.maxdgram to 9216 and net.inet.udp.recvspace to 10520, and download speed increased to 18-19Mbps but upload speed still hovered in the 0.40Mbps range.

Any suggestions as to where else to look?

User avatar
Pippin
Forum Team
Posts: 1201
Joined: Wed Jul 01, 2015 8:03 am
Location: irc://irc.libera.chat:6697/openvpn

Re: Very slow download speed with OpenVPN tunnel on FreeBSD

Post by Pippin » Thu Mar 03, 2016 9:09 pm

upload speed is within the 13-14Mbps range but the download speed ... 0.25-0.41Mbps range.
download speed increased to 18-19Mbps but upload speed still hovered in the 0.40Mbps range
I think you mean other way around? ^^^^

What up/down for VPS?
What up/down for iPhone?
net.inet.udp.maxdgram to 9216 and net.inet.udp.recvspace to 10520
Don`t know enough about that but would leave it alone.

Yes, could also be MTU.
I think i read somewhere that fragment and/or mssfix not work on iPhone.
You could do a search for that.

Post Reply