I'm trying to a upload a Flex generated SWF file (500 kb) from my Macbook (running Snow Leopard) using the command

scp main.swf server.com:/

I had setup key authentication to prevent typing the user/pass every time. This process normally takes up to two minutes using my connection at home (768kbps down/300+ kbps up).

The interesting part is that when I use WinSCP in my Windows XP machine, the process only takes 30-40 seconds max.

Both my MacBook and Windows XP machine use the same internet connection. The MacBook is connected to the router via cable (which should be faster right?) while the Windows XP connects through Wifi.

Let me know if you need additional information in order to diagnose the problem.



Posting additional info on the two setup following xenny's lead.

OSX: Core 2 Duo 2.0 GHz 4GB RAM

Windows XP Pentium D 2.8 GHz 2GB RAM

Here are the WinSCP settings: Session protocol = SSH-2 SSH implementation = OpenSSH_4.7p1 Debian-8ubuntu1.2 Encryption algorithm = aes Compression = No File transfer protocol = SFTP-3

I tried -c aes in OSX but it displayed an "unknown cipher type" message.


The MacBook is using a more computationally 'expensive' cipher than WinSCP on the PC, and this is causing the slowdown.

If the MacBook is currently CPU bound, adding to the load by compressing the data stream may well make things worse.

If you use ssh -c to choose a less expensive cipher, your problem should be resolved. I'd suggest starting by looking at what cipher the XP machine is using, presuming both machines have comparable processor performance.

  • This is probably the most logical explanation for the problem I mentioned. You're hunch is right on the ssh -c option, it took an additional 1 minute to complete based on my tests. I'll try to check the cipher that XP is using. Only problem is, how do you go about that anyway? I'm using an early 2009 MacBook with Core 2 Duo 2.0 G processors while the XP machine is on Pentium D 2.6 G processors. Thanks xenny! :) – pm_labs Mar 24 '10 at 14:27
  • Sorry, I meant -C (for the compress switch). – pm_labs Mar 24 '10 at 14:39
  • It seems silly that the macbook is spending so much CPU time on ciphers and compressions that it can't pump out 300kpbs. More likely the server is overtaxed. – jldugger Mar 24 '10 at 17:55
  • It looks like jldugger is right, I opened Activity Monitor and the CPUs were not being maxed out. I'll try to run scp on verbose (-v) to check the settings on the OSX. – pm_labs Mar 25 '10 at 7:02

The main thing you should check out is how fast you can possibly expect it to go. If your internet upload is 300Kbps, neither wifi nor wired connections to the router should be the bottleneck here. Use some simple math to verify or disprove this; if it's a megabyte in size you should expect it to take 3 seconds (-ish).

If it's not a local config problem, or is unfixable, you can use scp -C for compression to speed up large transfers. Or you can use rsync, if you're uploading new versions of the same swf over and over; if it's mostly identical the speedup can be quite large.

  • Unfortunately, the scp -C approach took more time (total of three minutes). I'd love to try rsync but I don't think this is setup in the server. I got the error: bash: rsync: command not found. At the moment, I don't have enough access to enable this option. – pm_labs Mar 24 '10 at 14:22

You can also try to use rsync instead of scp for updating. This will allow to only transfer the changed data of the new version when directly replacing your .swf file.

Suggested syntax: rsync --compress --times --progress main.swf server.com:/path/to/final/directory/on/the/webserver For more information see man rsyncand be prepared for a quite overwhelming man page.

  • The rsync option looks promising but I would have to contact our server admin first to get this configured on the server. – pm_labs Mar 24 '10 at 14:23
  • rsync comes standard with Mac OS X and I expect it to be available on most Linux distros as well. You can just give it a try as rsync can use ssh as a transport. – MacLemon Mar 25 '10 at 22:04

Following xenny's suggestion of a different cipher, I'd suggest the blowfish-cbc cipher. It's the least computationally-expensive cipher available in OpenSSH, and while it's not the most secure cipher available it's much faster. I often see massive (2-10x) increases in speed from changing to blowfish, so I'd recommend giving it a shot.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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