Shrink the four handler queues from 100,000 to 20,000 (closes #11) #21

Merged
clawbot merged 1 commits from issue-11-shrink-handler-queues into next 2026-09-21 16:29:39 +02:00
4 changed files with 19 additions and 12 deletions
+5 -3
View File
@@ -10,9 +10,11 @@ import (
) )
const ( const (
// asHandlerQueueSize is the queue capacity for ASN operations // asHandlerQueueSize is the queue capacity for ASN operations, about 4
// DO NOT set this higher than 100000 without explicit instructions // seconds of feed at peak. The streamer drops rather than blocks when a
asHandlerQueueSize = 100000 // queue is full, so this bounds memory. Batches still flush on a timer
// (asnBatchTimeout), so a queue smaller than asnBatchSize is fine.
asHandlerQueueSize = 20000
// asnBatchSize is the number of ASN operations to batch together // asnBatchSize is the number of ASN operations to batch together
asnBatchSize = 30000 asnBatchSize = 30000
+5 -2
View File
@@ -14,8 +14,11 @@ import (
) )
const ( const (
// peerHandlerQueueSize is the queue capacity for peer tracking operations // peerHandlerQueueSize is the queue capacity for peer tracking operations,
peerHandlerQueueSize = 100000 // about 4 seconds of feed at peak. The streamer drops rather than blocks
// when a queue is full, so this bounds memory. Batches still flush on a
// timer (peerBatchTimeout).
peerHandlerQueueSize = 20000
// peerBatchSize is the number of peer updates to batch together // peerBatchSize is the number of peer updates to batch together
peerBatchSize = 10000 peerBatchSize = 10000
+4 -4
View File
@@ -11,10 +11,10 @@ import (
) )
const ( const (
// peeringHandlerQueueSize defines the buffer capacity for the peering // peeringHandlerQueueSize is the buffer capacity for the peering handler's
// handler's message queue. This should be large enough to handle bursts // message queue, about 4 seconds of feed at peak. The streamer drops
// of BGP UPDATE messages without blocking. // rather than blocks when a queue is full, so this bounds memory.
peeringHandlerQueueSize = 100000 peeringHandlerQueueSize = 20000
// minPathLengthForPeering specifies the minimum number of ASNs required // minPathLengthForPeering specifies the minimum number of ASNs required
// in a BGP AS path to extract peering relationships. A path with fewer // in a BGP AS path to extract peering relationships. A path with fewer
+5 -3
View File
@@ -14,9 +14,11 @@ import (
) )
const ( const (
// prefixHandlerQueueSize is the queue capacity for prefix tracking operations // prefixHandlerQueueSize is the queue capacity for prefix tracking
// DO NOT set this higher than 100000 without explicit instructions // operations, about 4 seconds of feed at peak. The streamer drops rather
prefixHandlerQueueSize = 100000 // than blocks when a queue is full, so this bounds memory. Batches still
// flush on a timer (prefixBatchTimeout).
prefixHandlerQueueSize = 20000
// prefixBatchSize is the number of prefix updates to batch together // prefixBatchSize is the number of prefix updates to batch together
prefixBatchSize = 25000 prefixBatchSize = 25000