Page 1 of 1

OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Fri Dec 05, 2014 9:11 am
by eugenevorld
Hi I'm running OpenVPN on a Debian VPS from Vultr's Sydney servers and I ran a speed test on it from speedtest.net
The VPS has 768MB ram and a single CPU
The upload download speeds of the server were around 100Mbps;
Image
and so I thought OpenVPN would run quite well on it but I ended up getting much slower speeds than I thought.

I tested this with my home broadband connection which is usually this fast;
Image
but after connecting to the VPN, the speed was this;
Image

I thought this may be related to my home broadband but then I also tested it on a 4G connection (I don't have the results for the 4G connection but it was much faster than broadband) and still ended up with the same 4Mbps.

From where I am connecting to the VPS, there is around 67ms ping.

This is my config file:

Code: Select all

port 8080
proto tcp

dev tun

tcp-nodelay

ca ca.crt
cert server.crt
key server.key
dh dh1024.pem

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

duplicate-cn

keepalive 10 120

comp-lzo

persist-key
persist-tun

status openvpn-status.log

verb 3

push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
I've heard that using UDP instead of TCP gives performance improvements but my setup requires to use TCP since the client connects through a proxy.
I'm not sure if these speeds are what to be expected or if there is something I can do about it like adding more RAM to the server or something.

I think higher latency might slow down the throughput but I'm not completely sure.
Thanks, :)

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Mon Dec 15, 2014 9:46 am
by eugenevorld
Image
(bump)

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Tue Feb 24, 2015 1:37 pm
by eugenevorld
One more bump, also additionally, I was wondering if this had something to do with OpenVPN and if I would get faster speeds using L2TP instead.

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Tue Feb 24, 2015 3:00 pm
by Traffic
eugenevorld wrote:I've heard that using UDP instead of TCP gives performance improvements but my setup requires to use TCP since the client connects through a proxy.
Perhaps the proxy has some limitations ..

UDP is usually much better performance than TCP .. so you may just have to accept the limitations imposed by TCP.

There are some settings you can try to see if it improves your TCP performance.

See the Manual for:
  • --sndbuf size
    Set the TCP/UDP socket send buffer size. Currently defaults to 65536 bytes.

    --rcvbuf size
    Set the TCP/UDP socket receive buffer size. Currently defaults to 65536 bytes.

    --txqueuelen n
    (Linux only) Set the TX queue length on the TUN/TAP interface. Currently defaults to 100.

    --nice n
    Change process priority after initialization ( n greater than 0 is lower priority, n less than zero is higher priority).

    --comp-lzo no (Disable lzo)

    --tcp-queue-limit n
    Maximum number of output packets queued before TCP (default=64).

    When OpenVPN is tunneling data from a TUN/TAP device to a remote client over a TCP connection, it is possible that the TUN/TAP device might produce data at a faster rate than the TCP connection can support. When the number of output packets queued before sending to the TCP socket reaches this limit for a given client connection, OpenVPN will start to drop outgoing packets directed at this client.
Not much else we can offer ...

Note: Your client upload speed is a bottleneck, although I cannot say how much it will impact your performance, that depends on what you are using the VPN for.

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Tue Feb 24, 2015 10:29 pm
by eugenevorld
Thanks for the reply, just wondering, do you have an OpenVPN server and what's the throughput like on yours with VPN and direct connection?

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Tue Feb 24, 2015 11:13 pm
by Traffic
Image

VPN: Grade F :lol: but I don't need to stream movies ...

That is my slowest node.

This may give you a better picture:
https://community.openvpn.net/openvpn/w ... orks_Linux

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Tue Feb 24, 2015 11:35 pm
by eugenevorld
Haha, yeah that's quite slow. Are you running a server from home or is this on a VPS? What's the upload/download like for the server, don't need exact figures just around about.

Re: OpenVPN speed is 1/20th the speed of the VPS upload.

Posted: Sun Mar 15, 2015 1:42 pm
by eugenevorld
I've tweaked it so that it's slightly better by following this post on lowendtalk.com, http://lowendtalk.com/discussion/40099/ ... cool-story

The main bit was this:

Code: Select all

sndbuf 0
rcvbuf 0
push "sndbuf 393216"
push "rcvbuf 393216"
Which was able to cap my broadband connection and so I tried it with a 4G mobile connection,

Direct connection (20.63/4.97):
Image

VPN connection (10.69/2.59):
Image

VPN connection (--cipher none) (12.58/2.94):
Image

I tried tun-mtu 48000 which got me to 12mbps download on the 4G connection with blowfish cipher following the wiki page on optimizing performance on gigabit networks, https://community.openvpn.net/openvpn/w ... orks_Linux

It's better but it's still not at full capacity, but this was a 3x improvement over the previous setup so I can't say I am not happy.