Skip to content

Fixed size buffer for QUICStream instead of object stream #5

Closed
@CMCDragonkai

Description

@CMCDragonkai

Specification

The QUICStream should be configurable with fixed size buffer. It turns out BYOB streams is not relevant for this. So instead we just need the options to configure the high water mark and related options.

Right now the stream just takes whatever chunk is acquired from the quiche library. So technically it's an object stream and not a byte stream.

@tegefaulkes need your input here to expand the spec, as you've done this already in PK with the websocket streams and RPC streams.

Benchmarks should push large amounts of data and observe that it doesn't really in very large amounts of memory usage.

Note that the quiche configuration does have configuration regarding the stream buffer limits... and even the connection buffer limits too.

The QUICStream buffer limits is purely a JS thing. So those buffers in quiche is controlling rust's memory usage. Subsequently quic stream's buffer limits is controlling JS's memory usage.

So:

QUICSTREAM <- QUICHESTREAM

If the quic stream buffer is full, it just stops reading from the quiche stream, which means the quiche stream buffer will be full, and that will produce backpressure on the remote side.

It's possible for the quichestream to be full before the quicstream is full.

Additional context

Tasks

  1. Add configuration option for setting the max buffer size for readable streams in QUICStream.
  2. Propagate this config up to where it's needed, QUICConnection, QUICClient, QUICServer, etc.
  3. Configure the readable streams to make use of the high water mark and interpret buffer size in bytes.
  4. Set a reasonable default size.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions