From 69fece067a5a9d7f3ab1805d57c1769368d41a0c Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Fri, 29 Jan 2021 16:32:40 +0000 Subject: [PATCH] Comments --- syncapi/streams/stream_pdu.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go index 220629cfb..ae38dc30e 100644 --- a/syncapi/streams/stream_pdu.go +++ b/syncapi/streams/stream_pdu.go @@ -11,9 +11,15 @@ import ( "go.uber.org/atomic" ) -const PDU_STREAM_QUEUESIZE = 2048 +// The max number of per-room goroutines to have running. +// Too high and this will consume lots of CPU, too low and complete +// sync responses will take longer to process. const PDU_STREAM_WORKERS = 256 +// The maximum number of tasks that can be queued in total before +// backpressure will build up and the rests will start to block. +const PDU_STREAM_QUEUESIZE = PDU_STREAM_WORKERS * 8 + type PDUStreamProvider struct { StreamProvider