mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-05 13:35:20 +00:00
Neither direction applied backpressure: a client that stopped reading grew a queue up to 64 MiB, and a client streaming 16 MiB frames was read and forwarded as fast as it could send. A few such sockets pinned the event loop and pushed RSS past 1 GB. Each side now stops reading the other once 1 MiB is queued toward it, and a client that keeps the upstream paused for 30 s is closed. Client uploads are budgeted per session (1 MiB/s sustained, 16 MiB burst, realtime.maxClientBytesPerSecond), pre-open buffering pauses reads at 1 MiB instead of rejecting at 32 MiB, and clients get a 30 s ping so half-open sockets release their upstream and slot. Upstream frames use a zero mask and skip UTF-8 validation, which the relay never needed. The stats line gains elu. tools/realtime-stress gains abuse.mjs and a runbook phase for event-loop abuse.