Skip to content

How to Measure Network Bandwidth and Latency with qperf

Updated 2 min read

Updated: 28 September 2026 · Applies to: qperf 0.4.9 to 0.4.11 on AlmaLinux and Rocky Linux 9 (EPEL), Ubuntu 24.04 and 26.04, Debian 13

qperf measures bandwidth and latency between two Linux machines over TCP, UDP and, on suitable hardware, RDMA. Its strength is latency: it reports the round-trip time of small messages in microseconds, which is useful when tuning a cluster, a database replica or storage traffic between servers. We tested the commands with qperf 0.4.11 on Ubuntu 24.04.

qperf is no longer actively developed (the last changes are from 2022) and is not packaged for AlmaLinux, Rocky Linux or RHEL 10. For plain bandwidth tests, iperf3 is maintained and available everywhere.

Install qperf on both machines

apt install qperf                                  # Ubuntu, Debian
dnf install epel-release && dnf install qperf       # AlmaLinux, Rocky Linux 9

Run a test

  1. On the first server, start qperf in server mode. It waits for tests on TCP port 19765:
    qperf
  2. On the second server, run the tests against the first one:
    qperf 10.0.0.20 tcp_bw tcp_lat
  3. Read the result: bw is the throughput, latency the time for one small message to travel (one way).

Other useful tests: udp_bw and udp_lat for UDP, conf to show both machines' CPU and OS, and -t 30 to run each test for 30 seconds instead of the default 2.

Firewalls: use fixed ports

qperf uses the control port 19765 plus a random data port. To test through a firewall, fix both ports and open them on the server:

qperf -lp 4000                                    # on the server
qperf -lp 4000 -ip 4001 10.0.0.20 tcp_bw tcp_lat   # on the client

Open TCP ports 4000 and 4001 on the server (and UDP 4001 for the UDP tests) only for the client's address, and close them after testing.

Reading the numbers

  • Run each test several times; the first run can be slower.
  • Latency on the same local network is usually tens of microseconds; across the internet it is milliseconds, dominated by distance.
  • A test between two servers measures the whole path. If results are poor, test each server's disk and CPU load too, not only the network.

Official documentation: qperf on GitHub.

هل كانت المقالة مفيدة ؟

Still stuck? Open a ticket