2

I have a Raspberry Pi Zero W. Using LibreELEC I was able to transfer ~1mbs via ssh and samba. Using Raspbian Jessie Lite I got the same. Using wget to grab an ISO on the internet I was able to get 1.5mb/s (which is my current internet speed). When using wget http://192.x.x.x/file I was able to get the same speed (seems like a router issue now). On windows and linux (using iwconfig) I see my link speed is well over 10mb/s.

How do I improve ssh to get 1.5mb/s like wget? How do I raise that speed (I think it may be a router issue). How do I test speeds without a router? (I guess setting my windows machine as a adhoc network is most simple controlling the pi via ssh on my laptop)

1 Answer 1

1

First, make sure you're also keeping an eye on the other areas where things might be limiting your speed. You need to watch the CPU usage when you're doing the tests an ensure that's not maxing out, though that's unlikely at these kinds of speeds. You are also doing tests that involve writing to disk and are more likely to run into limits there. My Zero W with a fast SD card (Samsung Evo+) maxes out sequential writes at 6-8 MB/sec; you can get a quick estimate of yours with dd conv=fsync if=/dev/zero of=testfile bs=1M count=50. But if your intended application doesn't need to write the data to the disk, testing with a program such as netperf may be a better approach.

To test SSH without writing the disk you could use a command such as ssh -o compression=no remotehost dd if=/dev/zero bs=1M count=20 | dd of=/dev/null bs=1m. Note that I explicitly disabled compression on SSH to make sure we're actually transferring that amount of data.

It sounds as if you have a local Linux PC on your network (that I presume is a fairly fast "real" PC as opposed to another Pi); that would be a good host to use for testing locally, without going through your router. If you don't have that, I would grab a Debian Live image and boot that on your Windows box. It won't touch your harddrive and you'll be able to install and use the same networking tools there as you do in Raspbian.

9
  • I'm not sure what I'm going to do but for now I suspect I'll just put up with the slow speeds, transfer via http+nginx+wget instead of ssh when I can and physically attach my drive if I need to do a lot of file manipulation/browsing.
    – user65873
    Apr 21, 2017 at 2:25
  • When you do that ssh/dd command (ssh -o compression=no remotehost dd if=/dev/zero bs=1M count=20 | dd of=/dev/null bs=1m) what speeds do you get?
    – user65873
    Apr 21, 2017 at 2:26
  • What was the CPU usage while you were doing that SSH test? That's really important; it might be the SSH crypto that's hurting you. I can't tell you what speeds I get on my Pi Zero W since I'm away from it at the moment, but I'll let you know later. On a powerful (Intel i7) desktop machine I get well over 400 MB/sec, ssh'ing to 127.0.0.1.
    – cjs
    Apr 21, 2017 at 2:54
  • Let me know. CPU usage changes depending on if I'm using USB or USB+LUKS (I have work info on that drive). However both had same speeds during transfer
    – user65873
    Apr 21, 2017 at 3:20
  • Right, but the question we're trying to answer here is, "is the CPU limiting the transfer speeds"? If a CPU-intensive protocol runs at 1 Mbps with the CPU pinned at 100%, but a less CPU-intensive one runs at 2 Mbps with the CPU at 40%, changing the network configuration is not going to speed up the former protocol. As for LUKS vs. non-LUKS, this is precisely why you want to avoid disk I/O if you're trying to figure out purely what your potential network transfer rate is.
    – cjs
    Apr 21, 2017 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.