Upload "throttled" to ~100mbit on Ubuntu 19.04. Due to tun0 txqueuelen set to 100
Hi All,
TL;DR - Known limiter in OpenVPN affects PIA Linux client and will limit upload bandwidth to 100 mbit.
I've enjoyed being a user of this service for years now, and recently moved more in to learning the Linux side of things. I recently noticed an issue where my Ubuntu 19.04 system was struggling to send over 100mbit over a PIA VPN (which was installed via the .sh script downloaded off the site). This same application ran on the Windows server I was moving it off of much faster than I was getting once moved. (great service!)
After eliminating other parts and pulling out much hair I noticed that when connected, an "ip addr" command would show my ethernet with a 1000 after it and the tunnel had 100. It seemed at first the difference between gigabit and fastethernet but reading in to it, I learned it is the transmit queue length and is a known limiter in OpenVPN (which PIA uses).
I found this link https://community.openvpn.net/openvpn/wiki/Gigabit_Networks_Linux#txqueuelen and after a bit of learning I can confirm that if the VPN/tunnel is connected then the command "sudo /usr/bin/ip link set dev tun0 txqueuelen 1000" will adjust it and it more than doubled my upload speed. I did notice a minor system load increase which I would expect by pushing more data through, but thought I"d mention to others.
My two questions: Could a knowledge base article or more be done to raise awareness so others don't burn energy on finding this bottleneck? Is there a way I can add this setting to a .config (I did a weak attempt at the pia.ovpn file but didn't have an effect)?.... dare I dream of a checkbox to enable Large Transmit Queue? Currently I have to open a terminal and run the above command after reboot/reconnect.
I welcome any correction or education, but I think I've got it pretty nailed down to this.
- Thank you
Comments