How do FTP, FTPS, SFTP, and SCP compare in terms of transfer rate and how can I compare them through testing?

closed as off-topic by TheCleaner, mdpc, Ward, colealtdelete, ceejayoz Dec 9 '13 at 16:25

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – TheCleaner, mdpc, Ward, colealtdelete, ceejayoz
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Speed isn't the important difference between FTP and the others. – ceejayoz Dec 9 '13 at 16:25
  • I'm not sure why this was voted off-topic. It is certainly very relevant to my work as a professional sysadmin - why weren't file transfers using anywhere near the bandwidth of the entire connection path? – Dan Pritts Apr 28 '17 at 14:46
  • You can compensate for the speed difference of SFTP by using multiple TCP connections driven by LFTP and the mirror subsystem using SFTP without sacrificing security. It can even use multiple threads for one single large file. – Aaron Apr 28 '17 at 16:20

If you have a fast wide-area network you will find that sftp and scp are about the same speed, which is slow. They both suffer from performance problems in the underlying openssh. With modern hardware, this is not due to encryption overhead, but rather due to problems with the openssh implementation - it implements its own internal windowing mechanism which breaks down on fast connections.

These problems become more obvious on long-distance (higher latency) connections, but I've experienced slowness even on LANs.

These are well-documented, and patches are available to fix the problem. Patching either end of the connection can help; ideally you'd patch both ends. For more info and the patches, see High Performance SSH at Pittsburgh Supercomputer Center.

BTW, encryption overhead can become an issue too, once the windowing problem is solved. The patches have fixes for that too.

Meanwhile, you will find that ftp is woefully insecure; it sends passwords in plain-text.

ftps I think wraps the ftp protocol in SSL. it's probably faster than unpatched SFTP/SCP.

One final note: in my experience, the WinSCP client is (at least sometimes) painfully slow. I don't know why, but based on their FAQ I'm not the only person who's had this problem. So if you're scp'ing from Windows, and it seems slow, try a different client. Even with an unpatched openssh server, you can do much, much better with a different client. I'm not sure which are good clients, unfortunately.

  • 1
    Finally. Someone who knows what they are talking about. Yes, FTPS is basically FTP in the SSL. SFTP/SCP will always be slower then when using FTP – Jason Dec 18 '13 at 17:42
  • Do you have any idea why I get 300 kb/s with scp while getting around 10 Mb/s (nearly max speed) with sftp? That doesn't seem to be "about the same speed". This is over 100Mbps ethernet. – Paladin Mar 21 '16 at 22:17
  • Best guess, your scp is a flawed implementation (e.g. WinSCP), but your sftp isn't. Even if they are in the same GUI wrapper, they might be different on the inside. – Dan Pritts Jul 20 '16 at 18:43
  • Dan, any idea why this SSH Patch isn't applied to the main OpenSSH? Clearly it's 1~2 orders of magnitude better (>10x even on a 100Mbps LAN) so why isn't this the new OpenSSH standard? How can we make it so? – Gabriel Staples Aug 27 '17 at 3:47
  • My understanding is that PSC submitted the patches to the openbsd folks (who write openssh). They were not interested. I heard vague statements that none of the openbsd people had high-bandwidth connections and they didn't notice any issues, and/or necessarily believe there was a real problem. This was several years ago, and is hearsay, so I can't vouch for its accuracy. – Dan Pritts Sep 5 '17 at 20:02

In general all of the protocols will perform about the same. You are more likely to be limited by the speed of your network or disk than by the protocol.

Older versions of OpenSSH (SFTP/SCP) used a fixed window size that will limit the speed over high latency networks (say trans-atlantic). There is a patch set to fix this problem called HPN (High performance networking) and it is included in most modern installs of OpenSSH.

If you are running in to a situation such as a gigabit or faster LAN link and a slower CPU then SFTP/SCP may run into a bottleneck. You'll be able to tell because the ssh/scp/sftp process will be using 100% of cpu on the sending or receiving hosting. If you are using a newer version of OpenSSH (6.4+) you can enable a threaded version of the AES cipher that will be able to use more than 1 core to handle the encryption and will be less likely to be limited by CPU rather than disk or network bandwidth.

If you control both the sending and receiving side, OpenSSH 6+ also has an optional 'NONECIPHER' mode. This uses the regular encryption/keys etc to login to the remote machine, but then drops to an unencrypted connection for the actual file copying. This will remove that CPU overhead. There are safeguards built in to the NONECIPHER than prevent you from getting a shell that is not encrypted.

In the end the protocol should not be the limitation on speed, although older versions of ssh do have trouble with high latency links.

  • Good to know that the defaults are now to have the patches installed, although it looks like redhat has explicitly decided against it ( Also, Note that trans-atlantic latency isn't really all that much. Current ping rtts: umich -> stanford (california): 89ms. umich -> cambridge (uk) : 134ms. Also, isn't the combination of latency and bandwidth that causes the issue? so lower latency but higher bandwidth links can still have problems. – Dan Pritts Dec 18 '13 at 18:45

Based on encryption overhead, I'd say that plain FTP probably has slightly better performance than the other protocols, but it's probably negligible. I'd use the protocol that provides the security you need first, then worry about throughput.

That being said, you'll have to set up a test to find the real numbers. Everything above is just my opinion. If you're testing performance locally, set up a server on your network. If the end use will be over the internet, test from an external host.

  • The performance overhead is orders of magnitudes, not slight. Closer to 10x than 2x slower. I was surprised myself. – Gomibushi Jun 11 '16 at 17:14

As always, google holds the answers,
Which says FTP > FTPS > SFTP
FTP also appears to be faster than SCP in someone else's test( but I'd recommend trying it for yourself to see.
So just set up SCP and FTP on any random box on your network, then run a typical file transfer and see how long it takes on both

  • why do you say FTP is an internet protocol and SCP for the LAN? – Dan Pritts Dec 5 '13 at 20:04
  • 5
    Ah, I see you got that from the linked eHow article. eHow is wrong. Both protocols were designed for Internet usage. The article has several other errors; the writer clearly doesn't know what he/she is talking about. – Dan Pritts Dec 5 '13 at 20:14
  • Now that I think about it, you're right, I probably should have checked. – user197786 Dec 6 '13 at 15:08
  • Sites like eHow never know what they are talking about. – Jason Dec 18 '13 at 17:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.