LinuxCommandLibrary

netperf

TLDR

Run TCP throughput test

$ netperf -H [hostname]
copy
Run UDP test
$ netperf -H [hostname] -t UDP_STREAM
copy
Run latency test
$ netperf -H [hostname] -t TCP_RR
copy
Run test for specific duration
$ netperf -H [hostname] -l [30]
copy
Specify message size
$ netperf -H [hostname] -- -m [1024]
copy
Run with multiple connections
$ netperf -H [hostname] -C -c
copy
Start netserver (on remote host)
$ netserver
copy

SYNOPSIS

netperf [-H host] [-t test] [-l duration] [options] [-- testoptions_]

DESCRIPTION

netperf measures network throughput and latency. It consists of netperf (client) and netserver (server running on the remote host).
TCP_STREAM tests bulk data transfer throughput. It measures how fast data can be pushed through a TCP connection, useful for evaluating network capacity.
UDP_STREAM tests UDP throughput without TCP's overhead. Results show raw network capability but may include packet loss.
TCP_RR (request/response) measures latency - how long round trips take. This is critical for interactive applications and databases.
CPU utilization reporting helps identify whether the network or CPU limits performance. High CPU use during network tests suggests the endpoint is the bottleneck.
Socket buffer sizes affect performance. Larger buffers improve throughput on high-latency links but increase memory use.

PARAMETERS

-H HOST

Remote host running netserver.
-t TEST
Test type (TCPSTREAM, UDPSTREAM, TCP_RR, etc.).
-l SECONDS
Test duration.
-p PORT
Port for control connection.
-P PORT
Port for data connection.
-c
Report local CPU utilization.
-C
Report remote CPU utilization.
-f UNITS
Output format (K, M, G for bits/bytes).
-v LEVEL
Verbosity level.
-- -m SIZE
Message size for test.
-- -s SIZE
Local socket buffer size.
-- -S SIZE
Remote socket buffer size.

CAVEATS

Requires netserver on remote host. Firewall may block connections. Results affected by other network traffic. CPU measurement needs privileges on some systems.

HISTORY

netperf was developed by Hewlett-Packard starting in the 1990s as a network benchmarking tool. It became a standard for measuring network performance, used in countless benchmarks and academic papers.

SEE ALSO

iperf3(1), nuttcp(1), ping(1), netcat(1)

Copied to clipboard