I recently had a server with some bandwidth limitations (tested using scp
and rsync -P
), where I was wondering if the problem was the data being transferred, or the server's link speed.
The simplest way to debug and verify TCP performance is to install iperf3
and run an iperf speed test between the server and my computer.
On the server, you run iperf3 -s
, and on my computer, iperf3 -c [server ip]
.
But iperf3
requires port 5201 (by default) to be open on the server, and in many cases—especially if the server is inside a restricted environment and only accessible through SSH (e.g. through a bastion or limited to SSH connectivity only)—you won't be able to get that port accessible.
So in my case, I wanted to run iperf through an SSH tunnel. This isn't ideal, because you're testing the TCP performance through an encrypted connection. But in this case both the server and my computer are extremely new/fast, so I'm not too worried about the overhead lost to the connection encryption, and my main goal was to get a performance baseline.