mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 16:30:55 +01:00
lib/promscrape: reduce the number of concurrently executed processScrapedData calls from 2x of the number of CPUs to the number of CPUs
This should reduce the maximum memory usage for processScrapedData() function by 2x. The only part, which can be IO-bound in the processScrapedData() is pushData() call, when it buffers data to persistent queue if the remote storage cannot keep up with the data ingestion speed. In this case it is OK if the scrape pace will be limited.
This commit is contained in:
parent
5876821a16
commit
0a14b7bb82
@ -424,7 +424,7 @@ func (sw *scrapeWork) scrapeInternal(scrapeTimestamp, realTimestamp int64) error
|
||||
return err
|
||||
}
|
||||
|
||||
var concurrencyLimitCh = make(chan struct{}, 2*cgroup.AvailableCPUs())
|
||||
var concurrencyLimitCh = make(chan struct{}, cgroup.AvailableCPUs())
|
||||
|
||||
func (sw *scrapeWork) processScrapedData(scrapeTimestamp, realTimestamp int64, body *bytesutil.ByteBuffer, err error) (bool, error) {
|
||||
// This function is CPU-bound, while it may allocate big amounts of memory.
|
||||
|
Loading…
Reference in New Issue
Block a user