mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-08-06 20:49:46 +00:00
4c7c3d7672
set_bind_addr_for_peer_connector collected all local interface IPs as bind addresses but omitted 127.0.0.1. When connecting to localhost, the connector would bind to a non-loopback IP (e.g. 172.17.0.2 in Docker) and fail with connect timeout because routing from non-loopback to loopback doesn't work. Fix: prepend 127.0.0.1:0 to the bind address list. The connector tries all bind addresses, so loopback will be attempted first and succeed for localhost connections. Benchmark results in Docker (4 threads, 1400B, 10s): Ring: 508K pps, MpscTunnelSender::send 138ns UDP: 440K pps, MpscTunnelSender::send 294ns TCP: 440K pps, MpscTunnelSender::send 376ns All three tunnel types now converge and benefit from noop_waker sync send.
23 lines
661 B
Bash
Executable File
23 lines
661 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
NS_NAME="et_bench"
|
|
|
|
echo "=== Creating netns: $NS_NAME ==="
|
|
# Clean up old ns
|
|
sudo ip netns del "$NS_NAME" 2>/dev/null || true
|
|
|
|
# Create namespace
|
|
sudo ip netns add "$NS_NAME"
|
|
|
|
# Enable loopback inside namespace
|
|
sudo ip netns exec "$NS_NAME" ip link set lo up
|
|
|
|
echo "=== netns $NS_NAME ready ==="
|
|
echo "Both instances will share this namespace's loopback."
|
|
echo "TCP/UDP connections to 127.0.0.1 will work inside it."
|
|
echo ""
|
|
echo "Now run the bench with HOTPATH_NETNS=$NS_NAME:"
|
|
echo " HOTPATH_TUNNEL=tcp HOTPATH_NETNS=$NS_NAME HOTPATH_BENCH_SECS=15 \\"
|
|
echo " cargo run --profile hotpath --features hotpath --example cpu_hotspot_ring"
|