From b26140f19043d6b57b62e311fc1a991b40ac8a16 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Wed, 13 Jul 2022 15:08:21 -0400 Subject: [PATCH] test: less prefetch more workers at the same time --- internal/cmd/worker.go | 2 +- internal/worker/notifications.go | 2 +- render.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cmd/worker.go b/internal/cmd/worker.go index 0a93a57..03f49ef 100644 --- a/internal/cmd/worker.go +++ b/internal/cmd/worker.go @@ -83,7 +83,7 @@ func WorkerCmd(ctx context.Context) *cobra.Command { }, } - cmd.Flags().IntVar(&multiplier, "multiplier", 12, "The multiplier (by CPUs) to run") + cmd.Flags().IntVar(&multiplier, "multiplier", 4, "The multiplier (by CPUs) to run") cmd.Flags().StringVar(&queueID, "queue", "", "The queue to work on") return cmd diff --git a/internal/worker/notifications.go b/internal/worker/notifications.go index e4fdbcd..8665c29 100644 --- a/internal/worker/notifications.go +++ b/internal/worker/notifications.go @@ -93,7 +93,7 @@ func (nw *notificationsWorker) Start() error { nw.logger.Info("starting up notifications worker", zap.Int("consumers", nw.consumers)) - prefetchLimit := int64(nw.consumers * 10) + prefetchLimit := int64(nw.consumers * 2) if err := queue.StartConsuming(prefetchLimit, pollDuration); err != nil { return err diff --git a/render.yaml b/render.yaml index 5710586..3eb4893 100644 --- a/render.yaml +++ b/render.yaml @@ -91,7 +91,7 @@ services: maxInstances: 20 targetCPUPercent: 60 buildCommand: go install github.com/bugsnag/panic-monitor@latest && go build ./cmd/apollo - startCommand: panic-monitor ./apollo worker --queue notifications --multiplier 64 + startCommand: panic-monitor ./apollo worker --queue notifications # Stuck Notifications Checker - type: worker