Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Cap UDP stress orchestrator bursts to fit OS receive buffers - #392

Merged
SeanTAllen merged 1 commit into
mainfrom
fix-udp-stress-burst-caps
Sep 4, 2026
Merged

SeanTAllen merged 1 commit into
mainfrom
fix-udp-stress-burst-caps

Conversation

@SeanTAllen

Copy link
Copy Markdown
Member

The echo-verification oracle assumes zero datagram loss, so any kernel drop hangs the test. Three burst dimensions can overflow the server's UDP receive buffer on localhost:

Byte volume — the old 2 MB cap exceeded every platform's default receive buffer (Linux ~212 KB, Windows ~64 KB). Lowered to 64 KB.

Datagram count — each datagram costs ~700 bytes of kernel SKB overhead regardless of payload size, so a burst of 2400 one-byte datagrams consumed ~1.8 MB of buffer. Capped at 200 datagrams.

Scheduling contention — too few scheduler threads relative to clients delays socket reads long enough for the kernel to drop. Floored ponymaxthreads at roughly 2/3 the client count, and capped clients at 1.5× the available threads.

50 seeds pass locally on a 16-core Linux machine. CI runners (Linux/Windows) have max_threads=2, which clamps clients to 3 — all 10 CI seeds produce bursts well within buffer limits.

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Sep 4, 2026
The echo-verification oracle assumes zero datagram loss, so any kernel
drop hangs the test.  Three burst dimensions can overflow the server's
UDP receive buffer on localhost:

- Byte volume: the old 2 MB cap exceeded every platform's default
  receive buffer (Linux ~212 KB, Windows ~64 KB).  Lower to 64 KB.

- Datagram count: each datagram costs ~700 bytes of kernel SKB
  overhead regardless of payload size, so a burst of 2400 one-byte
  datagrams consumed ~1.8 MB of buffer.  Cap at 200 datagrams.

- Scheduling contention: too few scheduler threads relative to
  clients delays socket reads long enough for the kernel to drop.
  Floor ponymaxthreads at roughly 2/3 the client count, and cap
  clients at 1.5× the available threads.
@SeanTAllen
SeanTAllen force-pushed the fix-udp-stress-burst-caps branch from 70625a1 to 879acc5 Compare September 4, 2026 18:02
@SeanTAllen
SeanTAllen merged commit 7e41ffc into main Sep 4, 2026
9 checks passed
@SeanTAllen
SeanTAllen deleted the fix-udp-stress-burst-caps branch September 4, 2026 18:23
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Sep 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants