bench: add per-NIC source IP binding for multi-NIC benchmarks#465
Merged
harshavardhana merged 1 commit intoMar 12, 2026
Merged
Conversation
When a storage cluster has multiple NICs on different subnets the
warp client should send S3 traffic via the NIC that belongs to each
subnet, not leave it to arbitrary OS routing.
Changes
- warp client mode: the IP from "warp client <ip>:port" is extracted
at startup (clientListenIP) and all outbound S3 connections are
source-bound to that address via net.Dialer.LocalAddr, ensuring
each warp client process exclusively uses its assigned NIC
- standalone mode: detectLocalIP() probes the OS routing table with
a zero-packet UDP connect to select the correct local IP per
destination host; falls back to OS routing on error
- localIP is threaded through clientTransportWithLocalIP() into all
three transport variants: plain HTTP, TLS, and kTLS (both HTTP/1
via DialTLSContext and HTTP/2 via DialContext)
Correct dual-NIC topology (one warp client process per NIC):
warp client 192.168.11.2:7761
warp client 192.168.12.2:7761
warp get --warp-client=192.168.11.{1..9}:7761,192.168.12.{1..9}:7761 \
--host=192.168.11.{1..8}:9000,192.168.12.{1..8}:9000 ...
README documents the multi-NIC setup and the important warning
against using a single warp client process for both NIC addresses
(which would produce double-counted results).
klauspost
reviewed
Mar 5, 2026
klauspost
left a comment
Collaborator
There was a problem hiding this comment.
No objections, just one Q
klauspost
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
warp client <ip>:portmode: the listen IP is extracted at startup and all outbound S3 connections are source-bound to that address vianet.Dialer.LocalAddr, ensuring each warp client process exclusively uses its assigned NICdetectLocalIP()probes the OS routing table with a zero-packet UDP connect to select the correct local IP per destination host; falls back gracefully to OS routing on errorlocalIPis threaded throughclientTransportWithLocalIP()into all three transport variants: plain HTTP, TLS, and kTLS (both HTTP/1 viaDialTLSContextand HTTP/2 viaDialContext)Motivation
When a storage cluster has multiple NICs on different subnets (e.g. two 400 GbE NICs), warp clients should send S3 traffic via the NIC that belongs to each subnet. Without explicit source binding, OS routing may concentrate all traffic on one NIC regardless of the
--hostlist.Correct dual-NIC topology
Run one
warp clientprocess per NIC with an explicit listen IP:Each process owns one NIC and reports independent operations — no double-counting, full dual-NIC throughput utilised.