Skip to content

atenet-router limits kernel send queues to slow clients - #3321

Closed
Chuang Wang (chuangw6) wants to merge 1 commit into
agent-substrate:mainfrom
chuangw6:sockmem-router
Closed

Chuang Wang (chuangw6) wants to merge 1 commit into
agent-substrate:mainfrom
chuangw6:sockmem-router

Conversation

@chuangw6

@chuangw6 Chuang Wang (chuangw6) commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #3133; design and data in docs/network-socket-memory.md (#3319).

The Envoy ingress router sets TCP_NOTSENT_LOWAT to 16 KiB on its client sockets and its sockets to atunnel. New flags: --router-tcp-notsent-lowat (default 16384), --router-tcp-send-buffer and --router-tcp-receive-buffer (default 0).

Envoy benchmark, 100 slow clients, median of 3 Off Lowat 16 KiB Fixed 64 KiB buffers
socket KiB/conn 981 57 132
download MB/s, +10 ms 653 661 16

Separately, the actor clusters keep Envoy's default 256 MiB HTTP/2 stream window. In the benchmark each stalled stream held about 15 MiB of heap and kept growing. That's phase 2; see the doc's "Not covered".

  • Tests pass
  • Docs updated

@chuangw6
Chuang Wang (chuangw6) force-pushed the sockmem-router branch 2 times, most recently from 14145c5 to a914ca1 Compare October 27, 2026 17:17
@bowei Bowei Du (bowei) added area/network kind/feature An enhancement / feature request or implementation labels Oct 27, 2026
A client that stops reading lets each of its sockets queue up to
tcp_wmem's maximum, 4 MiB on GKE nodes, charged to the Envoy container
but missing from Envoy's statistics. With TCP_NOTSENT_LOWAT at 16 KiB, the
backlog stays in Envoy's buffers and upstream. In the Envoy benchmark this
cut socket memory behind a stalled client from 981 to 57 KiB per
connection, with throughput within run-to-run noise.

Add --router-tcp-notsent-lowat, default 16384, set as an Envoy socket
option on the TLS listeners and on the clusters that dial atunnel. 0
leaves the kernel default. --router-tcp-send-buffer and
--router-tcp-receive-buffer set fixed buffer sizes, off by default: they
cap a connection at the buffer size per round trip.

Signed-off-by: Chuang Wang <chuangw@google.com>
@chuangw6

Copy link
Copy Markdown
Collaborator Author

Merged into #3320.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/network kind/feature An enhancement / feature request or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants