perf: increase worker pool queue buffer size 1 -> ~4k

* Previosuly the worker queue pool buffer size was 1 which applies a backpressure on the fast missing blocks producer

* Define our queue size and why we chose this value
This commit is contained in:
2024-06-20 14:19:06 +08:00
parent 1419caeea7
commit fe01fd1f72
4 changed files with 34 additions and 21 deletions

View File

@@ -10,6 +10,7 @@ import (
type (
QueueOpts struct {
QueueSize int
Logg *slog.Logger
Processor *processor.Processor
Pool *pond.WorkerPool
@@ -27,7 +28,7 @@ type (
func New(o QueueOpts) *Queue {
return &Queue{
logg: o.Logg,
processChan: make(chan uint64, 17_280),
processChan: make(chan uint64, o.QueueSize),
stopSignal: make(chan interface{}),
processor: o.Processor,
pool: o.Pool,