OpenVPN - slow file transfer speed

Savicava

Cadet
Joined
May 8, 2023
Messages
2
Hello everyone, and welcome to my first post on this forum.
Feel free to criticize and be detailed, I often find that to be helpful :smile:

Before posting, I've searched for the "openvpn speed" keywords on the forum, but no luck.
In summary, I couldn't find a solution to my problem after more than a week of searching through the internet.
Every hint will be helpful, so thank you in advance!

I've been using TrueNAS Core server for about three months now.
Current OS version is 13.0-U4.
This is my first server, and it serves a home storage role.
Users, 99% myself and 1% my girlfriend, access the data via SMB. That's through the home network, and OpenVPN when remotely.
Server is connected to the network via the UTP cat. 5e cable, connected to the ISP supplied modem/router ZTE ZXHN H298Q v7 (single device).
My ISP uses a CG NAT, and I paid for a static public IP. This IP is used to setup my OpenVPN service in TrueNAS Core.
TrueNAS is the provider of my OpenVPN service, and a self-signed certification authority, using which i've generated server's, and the clients (users) certificates respectively.
Router is set to forward my 4-digit OpenVPN port of choice.
I've generated the OVPN profile, and imported it to our laptops and phones.
So OpenVPN connection to the "TrueNAS Core" server's SMB share is stable from all devices, but the file transfer speed is very limited in both directions.

Using an Android phone's OpenVPN client app, transfer speed doesn't go faster than 1-1.5 megabytes per second.
Using a Windows 11 laptop's OpenVPN client program, speed doesn't go faster than 15-20 megabytes per second.

Locally, when directly connected to the server without VPN, and using e.g. a Windows 11 or 10 laptop, transfer speeds exceed 60 megabytes per second.

These steps didn't affect the issue:
- Restarting the server and a router
- Accessing the server using a different internet provider and from another location
- Changing the OpenVPN protocol from TCP to UDP
- Using a different file type for transfer e.g. movie, program, images etc.
- Using different Windows laptops and Android phones to transfer files
- Changing the server connection MTP value from 1500 to 9000

Limited speeds are the same when transferring multiple files at once, meaning the total speed of all ongoing transfers is limited to the same value, as if transfering a single file.
Please find more details in the attached files.

Server's hardware:
Motherboard Gigabyte GA-H97-HD3 rev. 1.0 with Realtek® GbE LAN chip
CPU Intel G3250 @ 3.20GHz with an average temp. @40°C
RAM 16GB NON-ECC DDR3 in dual-channel @1333 MHz
PSU Antec 500W model VP500P plus non-modular
HDD Seagate Ironwolf 3TB NAS labeled as the only data storage drive in the system
NVMe SSD 256GB Western Digital SN 530 as the boot drive only
APC UPS BX1400U-GR

There is no ECC RAM or RAID unfortunately, but I will definitely change that in the near future with a much more suitable build.
 

Attachments

  • File transfer example.png
    File transfer example.png
    133.6 KB · Views: 143
  • OpenVPN Server settings.png
    OpenVPN Server settings.png
    62.8 KB · Views: 127
  • Server settings - Tunables.xlsx
    9.9 KB · Views: 107
  • OpenVPN log - 10 seconds.txt
    4.4 KB · Views: 88

Savicava

Cadet
Joined
May 8, 2023
Messages
2
Hello again.

It has been almost 2 months now, and the problem is still present.
Did another search for "openvpn speed" keywords again on the forum, but no luck.
TrueNAS is working fine otherwise, and I'm happy with it.

I started thinking, that the VPN transfer speed problem, could be due to the internet speed used by the device receiving the files over VPN, at least regarding the laptop tests, but the phone transfer speeds are just way too low even when considering that possibility.

See, my phone for example, which is Xiaomi Mi 9T, achieved 38 Mbps download speed tonight at 10:30 PM using the SIM's carrier internet, at full signal strength (see the attachment for more details). TrueNAS OpenVPN service is set so that anyone connecting, uses its own internet. After the internet speed test, I've started a file transfer via OpenVPN app (latest official version from the Google Play Store) from my TrueNAS to the phone's memory. You can see in the attachment, that the speed is around 1.4 MBps, and trust me, it doesnt go over 1.5 MBps, as I already mentioned in the original post. When I convert 38 Mbps to MBps I get a value of 4.75, and even if the VPN cuts it by 20% I should be getting 3.8 MBps not 1.3-1.5 MBps. It seems that the VPN is cutting 70% of the speed.

As in the original post, every hint or critique will be helpful, so thank you in advance!

Here are some updates:
- ISP replied that no speed limitations or problems are present, regarding the public IP service i'm using.
- My TrueNAS Core is now updated ti 13.0-U5.1.
- Solved OpenVPN connect/disconnect problem by adding "keepalive 10 60" to its parameters.
- Upgraded hardware to HPE Microserver generation 10 (specifications are in the attachment).
 

Attachments

  • HPE Microserver specificaitons.txt
    434 bytes · Views: 78
  • File transfer test.jpg
    File transfer test.jpg
    60.8 KB · Views: 92
  • Internet speed test.jpg
    Internet speed test.jpg
    62.7 KB · Views: 99
Top