From e56483dbb71d8645fa9da78a4e158d774758f9a9 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 7 Jul 2021 22:34:57 -0400 Subject: [PATCH] build up space for GC and main thread/statsd --- cmd/apollo-worker/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/apollo-worker/main.go b/cmd/apollo-worker/main.go index 2389f47..3434b27 100644 --- a/cmd/apollo-worker/main.go +++ b/cmd/apollo-worker/main.go @@ -30,7 +30,7 @@ type application struct { } var ( - workers int = runtime.NumCPU() * 6 + workers int = runtime.NumCPU() * 4 rate float64 = 0.1 backoff int = 5 ) @@ -209,8 +209,8 @@ func main() { ) // This is a very conservative value -- seen as most of the work that is done in these jobs is - // - runtime.GOMAXPROCS(workers) + // waiting around for IO. + runtime.GOMAXPROCS(workers + 2) // + 2 for main thread and GC. quitCh := make(chan bool, workers) for i := 0; i < workers; i++ { go accountWorker(i, rc, db, logger, statsd, quitCh)