one-way scp?
June 9, 2006 7:25 AM   Subscribe

Linux to Mac SSH connection: Why is scp so much slower in one direction?

I have a home wireless network of two Linux machines (a laptop and a desktop) and a G4 Mac mini. Between the two Linux machines I get a transfer rate of around 2.0MB/s in both directions using scp, and from the Mac to either of the Linux machines about the same.

The problem is with scp'ing stuff to the Mac mini. The rate starts out about 700KB/s, then settles down to about 400KB/s within a few seconds.

I also set up a Samba share on the Linux boxes, and I'm seeing the same slowdown using regular cp to/from the Mac.

Any ideas?
posted by ciaron to Computers & Internet (10 answers total)
Not sure myself, but you're not the first one with this problem.
posted by edd at 7:38 AM on June 9, 2006

Can you post the output of scp with the -v flag on? Feel free to obscure IP addresses and things if they are sensitive. I imagine that it might have something to do with the encyption scheme being used and the speed of decryption on the Mac Mini. -v should tell us exactly what encryption method you are using.

Hopefully it is using blowfish as that's the fastest one SSH usually supports I believe.
posted by public at 7:44 AM on June 9, 2006

public: that wouldn't explain why the same is seen on samba connections though, would it?
posted by edd at 7:47 AM on June 9, 2006

edd: Yes I failed to read the question entirely :P In which case, I have no idea. I don't tend to ever transfer files *to* my Apple hardware. Unless you count downloading but my cable maxes out at 450KB/s anyway.
posted by public at 7:50 AM on June 9, 2006

Oh... try turning off ipv6 in System Preferences (Network > Configure IPv6 > Off).
posted by edd at 7:55 AM on June 9, 2006

I already thought of IPv6 - it's off at both ends.

(I won't post the scp -v output directly - sounds like it may not be relevant. In case it's helpful, I've got it here:
scp from Linux, scp from Mac)
posted by ciaron at 8:06 AM on June 9, 2006

Try adjusting the sysctls. The Darwin TCP implementation is pretty slow and featureless, and Apple's default tuning values are rather conservative. There's only so much you can do about that, unfortunately.
posted by majick at 8:16 AM on June 9, 2006

Have you tried Apple's Broadband Tuner?
posted by Mr. Six at 8:54 AM on June 9, 2006

Check for errors in "ifconfig" output at both ends. (I don't use OS X, so someone else can correct me if the right place for error counters in OS X isn't "ifconfig" output.) On Linux, at least, you'll see something like
RX packets:57217 errors:0 dropped:0 overruns:0 frame:0TX packets:49802 errors:0 dropped:0 overruns:0 carrier:0
except maybe all those 0s won't be 0s. Also check for Ethernet autonegotiation problems. In Linux, you can do that with "mii-tool" or "ethtool". They give you output like
eth0: negotiated 100baseTx-FD flow-control, link ok
Speed: 100Mb/sDuplex: FullAuto-negotiation: on
respectively. If you see something there that isn't 100 MB full duplex, unless you're on an old non-switching hub, then there is something amiss with the way your devices are autonegotiating. Unfortunately I don't know the OS X equivalent.

Both the scp and samba data transfers are asymmetrical (big chunk of data sent; tiny ack returned) so errors occurring at one end wouldn't necessarily slow things down in both directions.

I wouldn't go adjusting things until you've diagnosed the problem, though, and the first place I'd look to diagnose the problem is at the ethernet and IP levels.
posted by mendel at 9:01 AM on June 9, 2006

A number of people have found that the samba socket options defaults on some Linux distributions aren't compatible with an OSX client -- this results in big slowdowns when transferring files from the Linux machine to the Mac. I'm not sure of the reasons but this seems to fix it. If in smb.conf you see the options


remove them (leave the other socket options alone), restart the samba daemons and see if that improves it. It won't help with the scp problem but this has helped a lot of people with samba.
posted by George_Spiggott at 10:32 AM on June 9, 2006

« Older How to get computer to recognize USB thumb drive   |   What is love?.. Newer »
This thread is closed to new comments.