I am transfering large media files to my local machine over an SSHFS mount. I am not too concerned about speed and want to provide a better QOS to other network services and so want to limit the bandwidth for these transfers.

I can't seem to find an option for this in the man page - how can I achieve this?

# uname -a
Linux core1 4.19.68-coreos #1 SMP Wed Sep 4 02:59:18 -00 2019 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux

One way would be to use a combination of iptables MARK to tag traffic to/from port 22 and traffic control tc to limit the egress rate of matched packets using a suitable qdisc.

An easier if less flexible way to get this working would be to pipe your sending process through pv (pipe viewer) using the --rate-limit and --buffer-size switches: https://linux.die.net/man/1/pv. You don't say if you're using a cli command like cp or rsync, or a gui desktop drag-and-drop to transfer your files. Using pv is likely a nonstarter if you're using a gui.

  • 2 very cool answers, I'm using sonarr so I guess just cp from the filesystem's perspective - I'll try the first one as the second one would be tricky with sonarr – dippynark Sep 29 '19 at 17:27

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.