From c630115be082f0a2da2cf796eb12fc470ad4b8ae Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 7 Jan 2023 00:18:49 -0800 Subject: [PATCH] lib/streamaggr: limit the the number of concurrent flushes of the aggregate data to the exact number of available CPUs This should reduce the maximum memory usage during concurrent flushes of the aggregate data --- lib/streamaggr/streamaggr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/streamaggr/streamaggr.go b/lib/streamaggr/streamaggr.go index c8de18c304..5fcf4be7e7 100644 --- a/lib/streamaggr/streamaggr.go +++ b/lib/streamaggr/streamaggr.go @@ -356,7 +356,7 @@ func (a *aggregator) runFlusher(interval time.Duration) { } } -var flushConcurrencyCh = make(chan struct{}, 2*cgroup.AvailableCPUs()) +var flushConcurrencyCh = make(chan struct{}, cgroup.AvailableCPUs()) func (a *aggregator) flush() { ctx := &flushCtx{