Skip to content

Link WebSocket: find which allocations hold a large create on the Home, then cut the copies or justify a reservation from named buffers #8600

Closed

Description

@lidge-jun

The link WebSocket memory acceptance (design 6.3, tests/e2e-style/link-websocket-rss.test.ts, opt-in with OCX_LINK_WS_RSS_ACCEPTANCE=1) compares the Home's peak RSS over a link WebSocket with the same stalled load over the HTTP link relay. Both runs use a held upstream and the same synchronization. At 24 sockets the difference is about 47 MiB per socket (1,123 MiB against the 768 MiB budget). Five pairs at four sockets gave 31.0, 33.4, 44.2, 45.7 and 47.1 MiB per socket.

What is known:

  • The excess follows the create size. With a 1 KiB create and 16 MiB upstream chunks the WebSocket adds 3.5 MiB per socket; with a near-8 MiB create and 256 KiB chunks it adds 65.2 MiB.
  • A heap breakdown at the stall (four sockets) shows the WebSocket Home holding about 38 MiB per socket more than the HTTP Home: Uint8Array about +12 MiB, BlobInternalReadableStreamSource about +8 MiB, strings about +7 MiB per socket, external memory about +23 MiB per socket.
  • Design 6.3 already counts the inbound 8 MiB message and about 21 MiB of send-side buffers. The rest is not attributed.

Work:

  1. Attribute each large allocation on the WebSocket path for a near-8 MiB create, from message receipt through parsing, the observers, request building and the upstream request body, against the HTTP relay's path for the same body. Use the OCX_LINK_WS_RSS_HEAP=1 diagnostic and OCX_LINK_WS_RSS_INPUT_BYTES.
  2. Cut copies that the WebSocket path makes and HTTP does not, or justify a per-socket reservation that sums named buffers.
  3. Give the HTTP link relay an observable stall, so that both runs of the acceptance are synchronized on a stall the Home reports. Today the HTTP run is synchronized only on the upstream's hold, and the acceptance refuses to pass on that basis.
  4. Rerun the canonical acceptance.

Until then the reservation stays at 32 MiB and the build's release gate stays closed. A reservation that is not understood is not a bound.

Evidence: the measurements on the structure page (structure/remote-link.md, link WebSocket pump paragraph).

Activity

  1. added
    enhancement
    on Nov 12, 2026
  2. added
    streaming
    on Nov 12, 2026
  3. lidge-jun commented on Nov 15, 2026

    @lidge-jun
    OwnerAuthor

    Closing as done on dev. #8622 and #8625 removed the copies the WebSocket path made and the HTTP relay did not (the frame is now parsed once and handed to the pipeline through attachParsedRequestBody), and #8647/#8680 gave both relays an observable stall and a settled measurement window. structure/remote-link.md records three settled canonical runs on 2e8b3f3: the WebSocket Home's peak over idle exceeded the HTTP Home's by 193, 287 and 129 MiB at 24 sockets, inside the 768 MiB reservation budget, and attributes what remains to the named transport buffers. Opening the link WebSocket release gate is tracked separately; this issue's attribution and acceptance work is complete.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementstreaming

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions