To fine-tune network throughput there are also tools such as cstream or mbuffer.
In addition to -t num
to throttle data throughput to num
bytes per second, cstream
, for example, not only has a -b num
option to set the block size used for read/write, but also a -B num
option to buffer an input block up to num
bytes before writing.
As an alternative to ssh
and rsync
you could try nc (netcat)
or ncat
, especially if the data stream is not going to go over the internet. ncat
is part of the Nmap Project and has SSL support though.
# netcat + tar + cstream example to throttle network throughput
# requires netcat on both servers
# cf. http://superuser.com/questions/291803/best-way-to-copy-millions-of-files-between-2-servers/
# cstream -T 10 -t 4m </dev/urandom >/dev/null # test
nc -l -p 2342 | tar -C /target/dir -xzf - # destination box
tar -cz /source/dir | cstream -T 30 -t 4m | nc Target_Box 2342 # source box