How to use qperf to measure network bandwidth and latency performance?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux
  • Networking

Issue

  • How to use qperf to measure network bandwidth and latency performance?
  • Is there a supported alternative to iperf to measure network throughput?
  • How do I test performance of RDMA?

Resolution

Installation

Install qperf from the RHEL server channel:

# yum install qperf

Checking for Bandwidth

Server

Have one system listen as a server:

server # qperf

The server listens on TCP Port 19765 by default. This can be changed with the --listen_port option.

This port will need to be allowed in any firewall present. On iptables:

iptables -I INPUT -m tcp --dport 19765 -j ACCEPT

Or on firewalld:

firewall-cmd --add-port=19765/tcp

Client

Have the other system connect to the server as a client:

# qperf -t 60 --use_bits_per_sec  <server hostname or ip address> tcp_bw

Results

Results are printed on the client only, the following result shows throughput between these two systems is 16.1 gigabit per second:

tcp_bw:
    bw  =  16.1 Gb/sec

If the --use_bits_per_sec option is not used, the throughput is supplied in GiB per second (or other applicable IEC binary unit):

tcp_bw:
    bw  =  1.94 GB/sec

Checking for latency

Client

# qperf -vvs  <server hostname or ip address> tcp_lat

Results

Results are printed on the client only, the following result shows latency value is 311 Microseconds and then there are few other details as well. loc_xx shows details from local system perspective and rem_xx shows the same from remote system perspective. Refer man qperf for more options / verbosity.

tcp_lat:
    latency         =    311 us
    msg_rate        =   3.22 K/sec
    loc_send_bytes  =   3.22 KB
    loc_recv_bytes  =   3.22 KB
    loc_send_msgs   =  3,218 
    loc_recv_msgs   =  3,217 
    rem_send_bytes  =   3.22 KB
    rem_recv_bytes  =   3.22 KB
    rem_send_msgs   =  3,217 
    rem_recv_msgs   =  3,217 
[user@localhost ~] $ 

Other Tests

Other tests are available, including UDP bandwidth and latency, SCTP bandwidth and latency, and other protocols which run on RDMA.

See the TESTS section of man qperf for more details.

Root Cause

qperf is a network bandwidth and latency measurement tool which works over many transports including TCP/IP, RDMA, UDP, and SCTP.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.