How to accelerate long-distance file transfer?

2023/03/24 14:26 Posted by admin

Most companies transfer files via HTTPS/FTPS/SFTP protocols, these application protocols rely on TCP as their underlying protocol, and TCP works well in most situations because network conditions are typically good. However, when you transfer files with poor network conditions (like transoceanic transfer), the network throughput can be substantially decreased, this is primarily due to TCP's sliding window algorithm which reduces the throughput when network latency increases. To solve the slow speed issue in long-distance file transfer, we introduced a UDP-based protocol "FastUDP" in the new version of WingFTP/Wing Gateway, it uses the advantage of UDP protocol and adds a reliable retransmission policy and has a much better performance than TCP in high latency network.

How to implement FastUDP file transfer?

For the server side, you need to install Wing FTP Server v7.2.0+ and Wing Gateway v1.1.2+. Under WingFTP's administration, navigate to "Domain -> Settings -> Listeners", you should add a HTTPS listener with the option "Use FastUDP mode for HTTPS":

For the client side, you need to run FTP Rush v3.5.5+. Just add a site under Site Manager, choose the protocol as "Wing FTP Server Web Client", and select the option "Encryption" as "HTTPS", then check on the option "Use FastUDP connection (for high latency network)":

Tests and comparison

We also tested the performance for both FastUDP-based HTTPS and traditional TCP-based HTTPS, we used an open source tool called tc (traffic control) to simulate packet loss and network latency. For example, if you want to simulate a 100ms delay with 0.5% packet loss for any packets going through eth0, just simply add a rule like this:

sudo tc qdisc add dev eth0 root netem loss 0.5% delay 100ms

Before adding a new rule or ending the test, don't forget to delete the old rule:

sudo tc qdisc del dev eth0 root

And all the tests are downloading a 100MB file in a fixed bandwidth network, with different latency and packet loss, we got the test results as below:

Clearly, when network conditions are good, TCP-based HTTPS is still better than FastUDP, but when network conditions are poor (high network latency and packet loss), FastUDP has a much better performance than TCP-based HTTPS. And TCP has the similar behavior in the internet connection, so we highly recommend you use FastUDP instead of TCP for long-distance HTTPS transfer, it will greatly save you time and money.