Skip to content

fix(mux-h2): emit fewer connection-level WINDOW_UPDATE frames when receiving DATA #1744

Closed

Description

@FlorentinDUBOIS

Sōzu returns connection-level flow-control credit with one WINDOW_UPDATE on stream 0 per h2_initial_connection_window / 2 octets of DATA received (RFC 9113 §6.9). With the 1 MiB default that is one frame per 512 KiB, so a single fast transfer, as H2 server receiving a request body or as H2 client receiving a backend response, emits hundreds of stream-0 WINDOW_UPDATE frames per second. Peers that rate-limit stream-0 WINDOW_UPDATE, Sōzu's own h2_max_window_update_stream0_per_window included, can treat this as a flood and close the connection.

A 64 MiB transfer currently costs 125 stream-0 WINDOW_UPDATE frames in either position.

The advertised connection window is not enforced and does not bound Sōzu's memory: a DATA payload is read only when its stream buffer has room, so the buffer pool bounds what Sōzu holds. A larger default lowers the frame rate without changing that bound. For comparison: Chromium uses a 15 MB session window, Envoy 24 MiB, Go's HTTP/2 client 1 GiB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions