Hard Numbers: HTTP/2 vs UDP Overlay for Agent Communication

Published: (March 16, 2026 at 06:00 PM EDT)
2 min read
Source: Dev.to

Source: Dev.to

Test Environment

  • Locations: Two machines on different continents – GCP us-east1 (South Carolina) and europe-west1 (Belgium).
  • Round‑trip time (RTT): ~85 ms.
  • Runs: 100 per test, median reported.
  • Benchmark type: Real‑world workloads, no synthetic benchmarks.

Connection Setup

ProtocolSetup StepsApprox. Time
HTTP/2TCP three‑way handshake (~85 ms) + TLS 1.3 handshake (~85 ms) + ALPN negotiation~175 ms per new connection
Pilot (UDP overlay)Expensive work (STUN discovery, tunnel creation) performed once at daemon startup; subsequent connections reuse the existing tunnel~15 ms per new connection

Orchestrator Overhead

When dispatching tasks to 50 agents:

  • HTTP/2: ~8.75 seconds of pure overhead.
  • Pilot: ~750 ms of overhead.

Message Latency

Latency is dominated by the 85 ms network RTT; protocol overhead is negligible.

Message SizeHTTP/2Pilot
1 KB (JSON task)172 ms171 ms
10 KB174 ms172 ms
100 KB182 ms179 ms
1 MB2.4 % faster (HTTP/2)

For the typical payload sizes agents actually send, the difference is irrelevant.

Memory Usage at Scale

  • 100 simultaneous peer connections:
    • HTTP/2: 240 MB RSS.
    • Pilot: 24 MB RSS.

All Pilot connections share a single UDP tunnel, eliminating a separate TCP socket and TLS session per peer. On resource‑constrained VMs this translates to running 100 agents with Pilot versus only 10 agents with HTTP/2.

NAT Traversal

  • Scenario: One agent behind Cloud NAT.
  • HTTP/2: Requires a relay proxy, adding 145 ms to setup and 32 ms to each message, reducing throughput by 31 %.
  • Pilot: Hole‑punches through NAT, establishing a direct tunnel. After the punch, overhead is +7 ms setup and +2 ms per message, with only 4 % throughput loss.

Conclusion

The decision isn’t “HTTP or Pilot.” It’s:

  • Use HTTP/2 where direct connectivity is guaranteed.
  • Use Pilot where NAT, corporate boundaries, or other network constraints exist.

For agents spanning diverse networks, the “must‑use” case applies to ≈ 88 % of deployments.

References

0 views
Back to Blog

Related posts

Read more »

Tool Every Developer Should Know: Netcat

Introduction While exploring networking and security tools recently, I revisited Netcat nc, often called the Swiss Army knife of networking. Despite being a li...

hello

Building Connections in the Developer Community Hey developers! As someone who's been in the tech space for a while, I'm constantly amazed by the collaborative...