Internet Speed degrades when connecting through VPN

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
lynspyre
OpenVpn Newbie
Posts: 5
Joined: Thu Jun 04, 2020 5:25 pm

Internet Speed degrades when connecting through VPN

Post by lynspyre » Sat Jun 20, 2020 7:34 pm

Hi,

I have an OpenVPN Server setup and running on Debian 10 in an LA Datacenter, UP/Down Speed on server is ~200 Mbps. Client ISP speed is Up ~5 Mbps/ Down ~20 Mbps, but when client connected through the VPN speed degrades to Up/Down ~5 Mbps.

This is speedtest result on server

Code: Select all

xxxxxx@vpn1-xxxxxxxx:/etc/openvpn/server# speedtest
Retrieving speedtest.net configuration...
Testing from QuadraNet (xxx.xx.81.87)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Race Communications (Mojave, CA) [276.07 km]: 1.574 ms
Testing download speed................................................................................
Download: 195.98 Mbit/s
Testing upload speed................................................................................................
Upload: 187.00 Mbit/s
This is speedtest on client without VPN
Image

This is speedtest on client with VPN
Image

This is Debian ip a output

Code: Select all

xxxxxx@vpn1-xxxxxxxx:/etc/openvpn/server# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
4: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc fq state UNKNOWN group default qlen 1000
    link/none
    inet 10.8.0.1 peer 10.8.0.2/32 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 xxxx::xxxx:b5f4:9f9d:f85/64 scope link stable-privacy
       valid_lft forever preferred_lft forever
741: eth0@if742: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether c2:51:ac:8a:5c:04 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet xxx.xx.81.87/31 brd 255.255.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 xxxx:xxxx:100:4600::1:77a0/124 scope global
       valid_lft forever preferred_lft forever
    inet6 xxxx::xxxx:acff:fe8a:5c04/64 scope link
       valid_lft forever preferred_lft forever
Thanks in advance.,

P.S.:I know I won't get full speed through the VPN, but at least I would like to improve it.

lynspyre
OpenVpn Newbie
Posts: 5
Joined: Thu Jun 04, 2020 5:25 pm

Re: Internet Speed degrades when connecting through VPN

Post by lynspyre » Mon Jun 29, 2020 3:37 am

I've found an answer on an old Forum that covered pretty much about how OpenVPN was created and why it sometimes behave in weird ways.

If you want to check it out, here it is the link.

Long history short, you need to edit your server and client config files and add these two lines

Code: Select all

sndbuf 0
rcvbuf 0
If those doesn't solve the issue, try only on server config file increasing the value of the previously added lines to something like this

Code: Select all

sndbuf 393216
rcvbuf 393216
But before doing this, I really recommend you to read the previous given post so you can really understand the reason behind it.

Post Reply