Skip to content

Commit

Permalink
fix: decrease max buffered amount for WebRTC datachannels (#2628)
Browse files Browse the repository at this point in the history
From experimental testing, 16MB is too big for Chrome to handle,
when sending large amounts of data - the `bufferedamountlow` never
fires.

Lower it to 2MB which seems to work better when running the Helia
transport benchmarks.
  • Loading branch information
achingbrain authored Jul 22, 2024
1 parent c164e2e commit 4a994c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/transport-webrtc/src/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface WebRTCStreamInit extends AbstractStreamInit, DataChannelOptions
/**
* How much can be buffered to the DataChannel at once
*/
export const MAX_BUFFERED_AMOUNT = 16 * 1024 * 1024
export const MAX_BUFFERED_AMOUNT = 2 * 1024 * 1024

/**
* How long time we wait for the 'bufferedamountlow' event to be emitted
Expand Down

0 comments on commit 4a994c5

Please sign in to comment.