1 min read 128 words Updated May 10, 2026 Created May 09, 2026
#cli-apps#linux#network#performance

Iperf

iperf is a fantastic tool to measure TCP throughput across a network or even the Internet

Quick Start

Install iperf on the two hosts you want to measure from. We'll call them "client" and "server"

sudo apt-get install iperf

On the server run iperf in server mode

$ sudo iperf -s

On the client, run iperf in client mode
$ sudo iperf -c <server>

If you get "connect failed: Connection refused" there is likely a firewall in the way. Make sure that port 5001/tcp is open!

Advanced usage

There are many options to iperf. Here are some of my favorites.

  • Use -w to adjust the TCP window size. A reasonable value is 512K, which will be adjusted by iperf to the actual size.