Skip to content

Commit

Permalink
Merge pull request #726 from brave-intl/fix/revert-num-cpu
Browse files Browse the repository at this point in the history
fix: revert CPU constraint
  • Loading branch information
Sneagan authored Jun 4, 2024
2 parents 4d26b63 + 53d0239 commit 7e6b2ae
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kafka/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"io"
"os"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -87,11 +86,7 @@ func StartConsumers(providedServer *server.Server, logger *zerolog.Logger) error

reader := newConsumer(topics, adsConsumerGroupV1, logger)

// Each message in batchPipeline is associated with goroutine doing
// CPU-intensive cryptography, so limit the channel capacity by CPU cores
// plus some extra buffer to account for IO that a processor may potentially
// do.
batchPipeline := make(chan *MessageContext, runtime.NumCPU()+2)
batchPipeline := make(chan *MessageContext, 100)
ctx := context.Background()
go processMessagesIntoBatchPipeline(ctx, topicMappings, reader, batchPipeline, logger)
for {
Expand Down

0 comments on commit 7e6b2ae

Please sign in to comment.