You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stream sources can produce chunks with variable sizes. This behavior leads to uncontrolable websocket message sizes, what makes 2 problems:
If chunks are too small -> a lot of messages -> poorer performance due to high fragmentation.
If chunks are too big -> small number of messages ->
2.1. In case of reconnection we'll have to resend big messages.
2.2. A lot of connections can take really big amounts of memory to handle such chunks.
Describe the solution you'd like
There must be a configurable chunk size, to which source chunks will be aligned. In any case writable stream should send chunks with constant size, except the last one with remaining data. Big chunks have to be divided into smaller messages and small chunks have to be batched into bigger messages.
Possible solution:
Create a Uint8Array with configured constant size and fill it up with data using DataView.
Send constant chunks while queue is not empty and writing is in progress.
Additional context
Configurable chunk size can be investigated and set to optimal default value.
The text was updated successfully, but these errors were encountered:
Problem description
Stream sources can produce chunks with variable sizes. This behavior leads to uncontrolable websocket message sizes, what makes 2 problems:
2.1. In case of reconnection we'll have to resend big messages.
2.2. A lot of connections can take really big amounts of memory to handle such chunks.
Describe the solution you'd like
There must be a configurable chunk size, to which source chunks will be aligned. In any case writable stream should send chunks with constant size, except the last one with remaining data. Big chunks have to be divided into smaller messages and small chunks have to be batched into bigger messages.
Possible solution:
Additional context
Configurable chunk size can be investigated and set to optimal default value.
The text was updated successfully, but these errors were encountered: