Connections, queue depth, and batch reads: tuning a one-sided RDMA cache
Saturating a 200 Gbps EFA link is not one big read, it is a concurrency problem. The
interesting part of benchmarking Rasa was not the headline latency, it was figuring out how
many reads had to be in flight at once for each object size, and the cheapest way to keep
them there. Numbers below are from one c8gn.16xlarge data node, reads over EFA.
One read is never enough
A single read, one connection issuing one request at a time, gives you the latency floor but usually not the bandwidth. At 1 MiB a lone read sees about 56 microseconds and 168 Gbps; at 4 KiB it sees 19 microseconds and 2 Gbps. The link is 200 Gbps, so for everything below a few megabytes a single in-flight read leaves the pipe mostly empty. The reason is the bandwidth-delay product: while one read is in flight for its round trip, the link could have carried far more bytes. To fill it you need enough reads outstanding at once that their bytes cover the round trip. The smaller the object, the more of them you need.
How many connections each size actually needed
Here is what it took to reach each size's ceiling, scaling connections (each issuing one read at a time) until throughput stopped climbing.
| size | connections | reads/s | bandwidth | p99 | p99.99 |
|---|---|---|---|---|---|
| 4 KiB | 32 | 1.53M | 50 Gbps | 31 us | 77 us |
| 32 KiB | 16 | 607k | 159 Gbps | 37 us | 80 us |
| 128 KiB | 6 | 184k | 193 Gbps | 44 us | 52 us |
| 1 MiB | 3 | 24k | 201 Gbps | 178 us | 205 us |
| 4 MiB | 1 | 6k | 201 Gbps | 208 us | 228 us |
| 16 MiB | 1 | 1.5k | 201 Gbps | 758 us | 793 us |
The progression is the whole point: 32 connections for 4 KiB, down to a single connection from 4 MiB up. Large objects carry so many bytes per read that one is enough to keep the link full; small objects need a crowd. And notice 4 KiB never reaches the line rate at all. Even at 32 connections and 1.53 million reads per second it tops out near 50 Gbps, because at that size the limit is no longer the NIC. It is how many operations the client can issue and poll for, which is a CPU problem, not a bandwidth one.
Concurrency is paid for in tail latency
Those latencies are the ceiling, the tail you see when the link is full, and they are not the same as the floor. A single read at 4 KiB returns in about 19 microseconds at p99 and 21 at p99.99; push to 32 connections for the throughput and the tail stretches to 31 and 77. At 1 MiB the floor is 56 and 61 microseconds, and the three-connection line-rate point is 178 and 205. Same node, same object, but the throughput config costs roughly three to four times the tail. From 4 MiB up there is no gap, because one connection is both the floor and the ceiling, so its latency is its only latency. The lesson is to report and choose an operating point on purpose: the floor for latency-sensitive reads, the ceiling for bulk throughput, and nothing pretends to be both.
Connections are the expensive way to get there
Connections are not the only way to raise the number of reads in flight. Each connection has a queue depth, the number of reads it keeps outstanding at once, and total concurrency is simply connections times queue depth. Throughput tracks that product, not how you split it. Two connections at queue depth 16 and thirty-two connections at queue depth 1 both put 32 reads in flight, and in our runs both delivered essentially the same throughput for the same size.
The difference is cost. Rasa's reader busy-polls its completion queue, so each connection spends roughly a core whether its queue depth is 1 or 16. That makes the two configurations very different bills for the same throughput: the 32-connection version burns about 32 client cores, the 2-connection version about 2. Queue depth buys concurrency almost for free; extra connections buy it a core at a time. So the rule we settled on was to raise queue depth first, and add connections only when one core genuinely cannot keep a connection's queue fed.
More in-flight is not always better. Past the point where the link is full, extra outstanding reads just sit in queues and add latency. At 1 MiB an over-deep queue turned a 56 microsecond read into a far slower one while adding no throughput, because three reads already saturate the link. The target is the bandwidth-delay product, enough concurrency to fill the pipe and not a read more.
How tight is the tail?
Averages hide the interesting part, so look at how a single size's latency spreads across percentiles. At the floor it barely spreads at all. A 1 MiB read is 56 microseconds at p99, 59 at p99.9, and 61 at p99.99: five microseconds of growth across two more nines. 4 KiB goes 19, 20, 21. Even 16 MiB only moves from 758 to 793. The 1-in-10,000 read is within about 10% of the typical one at every size.
That flatness is a property of the one-sided path. A read has almost nothing to jitter on. There is no server thread to queue behind, no garbage collector, no lock, no kernel scheduler, no per-request CPU work at all. The NIC moves the bytes over a path SRD already picked, and SRD's hardware retransmission absorbs an occasional dropped packet in microseconds, before it can become an outlier. What variance is left comes from fabric and PCIe scheduling, and it is small.
Under load the shape changes, and the variance you see is the variance you added. With many reads in flight some wait behind others at the NIC, so p99.99 pulls away from p99: 1 MiB at three connections is 178 then 205, and 4 KiB at 32 connections is 31 then 77. The widening tail is queueing you introduced for throughput, not the network getting worse. There is one more wrinkle at large sizes: a read in isolation on an idle cache can finish a little faster than the same read while the link is streaming at full rate, because at line rate the NIC is never idle. Below about a megabyte the two regimes agree; above it the sustained number is the conservative one, and it is the one in the table.
For small objects, the metadata is the enemy
There is a second tax that has nothing to do with the NIC. Every read needs a descriptor, the record that says which node holds the value and at what address and key. Resolving it is a control-plane lookup in Valkey. Do that per key and you serialize a Valkey round trip in front of every RDMA read, and for a 4 KiB value that lookup can cost more than the read it enables. The fast data path ends up waiting on a slow metadata path.
This is what batched reads fix. The SDK's get_many resolves every descriptor in
a single Valkey MGET, inserts each node's fabric address once, then builds a read
plan and pipelines the RDMA reads with a queue depth rather than waiting for each to finish.
One metadata round trip for the whole batch, then the NIC stays busy. For a KV-cache manifest
it goes further: a single manifest object names every block, so the client lands the whole
cache with one lookup and one pipelined read plan into a contiguous buffer. The same plan the
benchmark drives is the one the SDK exposes.
What never moved: the server
Through all of this tuning, connections from 1 to 32, queue depths from 1 to 16, batched or not, the data node stayed at about one core, roughly 1.6% of its 64. The NIC services the reads, so none of these knobs touch server CPU. Every dial we turned was on the client: how much concurrency to run and how many cores to spend issuing it. That is the unusual part of tuning a one-sided cache. You are sizing the caller, not the server.
The short version
To saturate EFA, get enough reads in flight to cover the round trip: a handful for large objects, dozens for small ones. Reach that concurrency with queue depth before connections, because connections cost client cores. Batch the descriptor lookups so metadata round trips do not gate the reads. And remember that below a few hundred kilobytes you are bounded by operations and client CPU, not bandwidth, which is why Rasa is built for large objects where a single connection already runs at line rate.
Numbers are from a single-node EFA sweep on a c8gn.16xlarge, no client-side
validation. Concurrency equals connections times queue depth; wire-rate figures assume a
200 Gbps link.