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

@@ -8,14 +8,15 @@ import (
)
type PoolOpts struct {
Logg *slog.Logger
WorkerCount int
Logg *slog.Logger
WorkerCount int
BlocksBuffer int
}
func NewPool(o PoolOpts) *pond.WorkerPool {
return pond.New(
o.WorkerCount,
1,
o.BlocksBuffer,
pond.Strategy(pond.Balanced()),
pond.PanicHandler(panicHandler(o.Logg)),
)