SockBench — RDMA & Socket Benchmarking

High-performance Linux benchmarking tool for comparing RDMA and TCP/UDP sockets.

Overview

SockBench is a Linux-based benchmarking tool designed to evaluate and compare different communication paths—RDMA (Remote Direct Memory Access) vs traditional TCP/UDP sockets. It provides reproducible measurements of latency, throughput, and scaling behavior across message sizes and connection modes.

The goal is to simplify the otherwise complex setup of RDMA-capable environments. With a single lightweight toolchain you can experiment with communication primitives, analyze bandwidth utilization, and build intuition about when low-latency RDMA is worth the complexity over conventional sockets.

Built as part of a systems-level exploration into high-performance networking, SockBench emphasizes clarity, minimal dependencies, and extendability (future: UDP, multi-threaded clients, epoll-based server, distributed multi-host runs).

Key Features

  • RDMA vs TCP/UDP (extensible design; current prototype focused on sockets)
  • Latency and throughput measurement with automatic CSV logging
  • Configurable message sizes & number of messages
  • Supports repeated batch benchmark runs via script
  • Lightweight CLI interface (no heavy dependencies)
  • Generated plots (latency & throughput vs message size)

Usage (from README)

  1. Compile
    g++ server.cpp -o server
    g++ client.cpp -o client
  2. Run
    Terminal 1 (server): ./server
    Terminal 2 (client): ./client 1024 10000
  3. Batch Benchmarks
    ./bench.sh (iterates across message sizes; outputs to results.csv)
  4. Plot Results
    python3 results/plot_results.py → outputs latency.png, throughput.png

Sample Results

Latency and throughput vary non-linearly with message size; small packets incur per-call overhead while larger packets saturate bandwidth.

Message SizeAvg Latency (ms)Throughput (MB/s)
32 B0.06180.49
64 B0.1790.34
512 B0.1593.07
1 KB0.09710.0
4 KB0.05373.8
64 KB0.0302049.9
Latency vs message size plot
Latency decreases as message size increases until system overhead amortizes.
Throughput vs message size plot
Throughput climbs rapidly with larger messages, approaching link saturation.

Challenges & Learnings

  • Explored Linux networking stack & soft-RoCE (rxe) constraints in virtualized setups
  • Balanced measurement stability vs runtime (warmup, batching, clock resolution)
  • Clarified trade-offs: RDMA’s low-latency path vs generality & simplicity of TCP/IP

Roadmap

  • Add UDP benchmarks for cross-protocol comparison
  • Introduce multi-threaded / multi-connection client
  • Non-blocking epoll server for scalability
  • Distributed multi-host orchestration

License

MIT License.

← Back to Projects
Next planned: add UDP + multi-connection benchmarks.