Solution to slow FTP Server speeds (Filezilla and others)

Posted by under Servers, on 23 March 2016 @ 10:50pm.

I recently found that despite having a 70Mbps (8.75MB/s) internet connection and a 1Gbps (125MB/s) dedicated server to download from, I could only seem to download from the FTP server at about 16.8Mbps (2.1MB/s) on a single thread. However over HTTP I could easily manage about 65.6Mbps (8.2MB/s) on a single thread. This confused me, as there should be no reason why the speeds should differ so wildly. I’d expect a little difference, but not that much.

After some forum discussions on Beta Archive regarding this (I looked into things after a user complained about slow speeds), a user told me that he uses IIS FTP Server with no such speed issues. This instantly told me that something wasn’t implemented or optimised properly on Filezilla and Gene6 FTP Server (the two servers I use). I started looking at the possibilities and quickly found the solution.

Solution!

The “internal transfer buffer size” and the “socket buffer size” values were set quite small on the server at just 32KB and 64KB. There is a notice that says too low or too high can affect transfer speeds. So I did what anyone would do… I bumped it up about 10 notches to 512KB on both of them! Instantly my transfer speeds hit 65.6Mbps (8.2MB/s), the same as I was getting over HTTP. Perfect!

filezilla_ftp_socket_and_buffer_size_options

More tests

I did a few more tests to make sure that I didn’t set it too high or too low, but it seemed OK. Going from 64KB to 128KB made the speed hit about 46.4Mbps (5.8MB/s). Better, but not good enough. 256KB buffer allowed me to hit 65.6Mbps (8.2MB/s), which is the maximum I’m likely to get due to protocol overheads.

Assuming that the buffer size doubling also doubles the speed, a buffer of 512KB should allow up to about 192Mbps (24MB/s) which really is more than enough for the things I need it to do. Given my connection is much slower than this, and broadband in the UK doesn’t really hit those speeds either, it should be plenty for now.

Filezilla only allows a maximum buffer size of 999,999 (almost 1024KB or 1MB) so the maximum it should allow (again assuming that the buffer doubling = speed doubling) is about 384Mbps (48MB/s). Other software might allow higher so by all means use it if you need to.