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)
- Compile
g++ server.cpp -o server
g++ client.cpp -o client
- Run
Terminal 1 (server):./server
Terminal 2 (client):./client 1024 10000
- Batch Benchmarks
./bench.sh
(iterates across message sizes; outputs toresults.csv
) - Plot Results
python3 results/plot_results.py
→ outputslatency.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 Size | Avg Latency (ms) | Throughput (MB/s) |
---|---|---|
32 B | 0.0618 | 0.49 |
64 B | 0.179 | 0.34 |
512 B | 0.159 | 3.07 |
1 KB | 0.097 | 10.0 |
4 KB | 0.053 | 73.8 |
64 KB | 0.030 | 2049.9 |


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.