Skip to content

bench: add per-NIC source IP binding for multi-NIC benchmarks#465

Merged
harshavardhana merged 1 commit into
minio:masterfrom
harshavardhana:dual-nic-source-binding
Mar 12, 2026
Merged

bench: add per-NIC source IP binding for multi-NIC benchmarks#465
harshavardhana merged 1 commit into
minio:masterfrom
harshavardhana:dual-nic-source-binding

Conversation

@harshavardhana

Copy link
Copy Markdown
Member

Summary

  • warp client <ip>:port mode: the listen IP is extracted at startup 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 gracefully 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)
  • README documents the correct multi-NIC topology and the warning against using a single warp client process for both NIC addresses

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 --host list.

Correct dual-NIC topology

Run one warp client process per NIC with an explicit listen IP:

# on each client machine (NICs 192.168.11.2 and 192.168.12.2):
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 \
  --access-key=minio --secret-key=minio123

Each process owns one NIC and reports independent operations — no double-counting, full dual-NIC throughput utilised.

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).
@harshavardhana harshavardhana requested a review from klauspost March 4, 2026 05:37

@klauspost klauspost left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objections, just one Q

Comment thread README.md
@harshavardhana harshavardhana merged commit 8e9ae3b into minio:master Mar 12, 2026
7 checks passed
@harshavardhana harshavardhana deleted the dual-nic-source-binding branch March 12, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants