Topic "Bad transfer performance with FTP on high latency links"

Author Message



We are using WinSCP as FTP-client and found it very useful. Thank you.

However, some of the server to which we upload are connected with large bandwidth (>100mbit/s) links, but which have high latency (>100ms). This is generally known as "long fat pipes" [1].

TCP has had multiple updates to accommodate this kind of links: new congestion mechanisms, window scaling, selective ACK, etc. New operating systems (e.g. Windows Vista and later) automatically use all these when CTCP is enabled (netsh interface tcp set global congestionprovider=ctcp), but also the application must have large TCP-buffers in use to fully benefit from this.

Would it be possible to have the TCP buffer sizes configurable, or at least hard coded to sufficiently large: 2 or 4 megabytes. I have actually patched the winscp.exe binary, to use larger TCP-buffers and fixed everything.

The patching is equivalent to modifying filezilla/TransferSocket.cpp, there's two parts that do SetSockOpt(SO_SNDBUF). However, the buffer size you pass there (2*BUFSIZE)=(2*16384)=32kB. However, that is far too low for "long fat pipes" such us ours. The buffer should be 2-4 megabytes.

Kind Regards,
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24736
Location: Prague, Czechia
Thanks for your suggestion.
This has been added to the tracker:
Martin Prikryl

prikryl wrote:
Thanks for your suggestion.
This has been added to the tracker:

Thank you. Increasing the SO_SNDBUF size fixes upload. (For me uploading to server with RTT 40ms, bumped from 600kB/s to 8-10MB/s which is link maximum; over 10x improvement).

It might be useful to have receive buffers (SO_RCVBUF) set too for downloading. Windows Vista and newer are supposed to have automatic TCP-buffer sizing, if it's not explicitly set. But I've seen it fail under certain circumstances. Additionally Windows XP and earlier set it incorrectly. <invalid hyperlink removed by admin> implies that Windows XP would never choose large enough buffer without registry modifications.

So it might be useful to have optionally set both the receive and send buffers.

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License