Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] - Update buffer #3255

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pkg/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ func (e *Engine) initialize(ctx context.Context) error {
// This reflects the anticipated lower volume of data that needs re-verification.
// The buffer size is a trade-off between memory usage and the need to prevent blocking.
verificationOverlapChunksChanMultiplier = 25
resultsChanMultiplier = detectableChunksChanMultiplier
)

// Channels are used for communication between different parts of the engine,
Expand All @@ -467,7 +468,7 @@ func (e *Engine) initialize(ctx context.Context) error {
e.verificationOverlapChunksChan = make(
chan verificationOverlapChunk, defaultChannelBuffer*verificationOverlapChunksChanMultiplier,
)
e.results = make(chan detectors.ResultWithMetadata, defaultChannelBuffer)
e.results = make(chan detectors.ResultWithMetadata, defaultChannelBuffer*resultsChanMultiplier)
e.dedupeCache = cache
ctx.Logger().V(4).Info("engine initialized")

Expand Down Expand Up @@ -651,7 +652,7 @@ func (e *Engine) startVerificationOverlapWorkers(ctx context.Context) {
}

func (e *Engine) startNotifierWorkers(ctx context.Context) {
const notifierWorkerRatio = 4
const notifierWorkerRatio = 2
maxNotifierWorkers := 1
if numWorkers := e.concurrency / notifierWorkerRatio; numWorkers > 0 {
maxNotifierWorkers = numWorkers
Expand Down
Loading