I have two Raspberry PI 2 Model Bs each located in a different country. The first Rpi2 runs the latest Rasbian Jessie and acts as an OpenVPN server (and SSH, SMB server as well). It also has an external hard drive attached to it via USB. The pi is connected to a fiber optics network via ethernet and has download/upload speeds of 100 Mbits (=12.5 MBs).
The second Rpi2 runs the latest OSMC and alongside Kodi acts as a OpenVPN client as well. It is connected to a solid network via ethernet and has download/upload speeds of 25 Mbits (=3.125 MBs) and 1 Mbits (=0.125 MBs) respectively. Moreover, when the OpenVPN client Rpi2 (OSMC) connects to the OpenVPN server Rpi2 (Jessie), a simple http command line speedtest shows almost a 25 Mbits (=3.125 MBs) download speed, hence we can see that the client basically use all of the available bandwith, which is what I want and expect.
I want to use my OSMC client pi to first connect to the OpenVPN server pi and then connect to the Samba share to access my hard drive’s content vai Kodi. I am able to do this by using the Kodi’s built in Samba client (via Add Network location). After establishing an OpenVPN tunnel, I can then connect to the server pi via Kodi’s SMB or SSH and access the needed files. However, the issue is that whenever I copy a file from the server to the client via the built-in Samba client (the same happens with SSH), the download speed is only around 4 Mbits (=0.5 MBs).
Naturally, I did some additional testing to try to figure out where the issue lies.
- When I connect to the OpenVPN server from my Mac (OpenVPN client) and do a file transfer over SMB via Finder’s built-in Samba client, then the transfer speed is great - it uses all bandwith of 25 Mbits (=3.125 MBs). The speed is the same when I do a file transfer over SSH as well. So there is nothing wrong with the pi’s SMB/SSH server when running over OpenVPN tunnel. But when I do the same via Kodi’s Samba client, then the download speed is only around 4 Mbits (=0.5 MBs) - the exact same issue as with my OSMC Rpi2 acting as an OpenVPN client.
- When I do a file transfer via Kodi’s samba client from a samba server located at local network, then the speed is close to 100 Mbits (=8.125 MBs). This is as expected.
I speculate that the issue lies at Kodi’s way of handling SMB and SSH client, because when behind an OpenVPN tunnel they slow down the transfer speed. This happens on Kodi runnning on both OSMC and Mac OS X.
Does anyone have any ideas on how to fix this?