From 62e19089865ee9062e0ab2236ddee467d7ece7a0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sat, 20 Jun 2020 17:52:49 +0300 Subject: [PATCH] lib/promscrape: reduce default value for `-promscrape.discovery.concurrency` from 500 to 100 This should reduce load on Kubernetes API server and Consul when big number of targets are discovered Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/574 --- lib/promscrape/discoveryutils/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/promscrape/discoveryutils/client.go b/lib/promscrape/discoveryutils/client.go index 0fe0d8adf..b8b70f938 100644 --- a/lib/promscrape/discoveryutils/client.go +++ b/lib/promscrape/discoveryutils/client.go @@ -17,7 +17,7 @@ import ( ) var ( - maxConcurrency = flag.Int("promscrape.discovery.concurrency", 500, "The maximum number of concurrent requests to Prometheus autodiscovery API (Consul, Kubernetes, etc.)") + maxConcurrency = flag.Int("promscrape.discovery.concurrency", 100, "The maximum number of concurrent requests to Prometheus autodiscovery API (Consul, Kubernetes, etc.)") maxWaitTime = flag.Duration("promscrape.discovery.concurrentWaitTime", time.Minute, "The maximum duration for waiting to perform API requests "+ "if more than -promscrape.discovery.concurrency requests are simultaneously performed") ) @@ -65,7 +65,7 @@ func NewClient(apiServer string, ac *promauth.Config) (*Client, error) { ReadTimeout: time.Minute, WriteTimeout: 10 * time.Second, MaxResponseBodySize: 300 * 1024 * 1024, - MaxConns: *maxConcurrency, + MaxConns: 2 * *maxConcurrency, } return &Client{ hc: hc,