Description
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
- Add configuration option for setting the max buffer size for readable streams in
QUICStream
. - Propagate this config up to where it's needed,
QUICConnection
,QUICClient
,QUICServer
, etc. - Configure the readable streams to make use of the high water mark and interpret buffer size in bytes.
- Set a reasonable default size.