From c8a776181262aaaa766752a10578842185c70fd7 Mon Sep 17 00:00:00 2001 From: Suraj Nath <9503187+electron0zero@users.noreply.github.com> Date: Thu, 11 Aug 2022 18:42:19 +0530 Subject: [PATCH 1/2] Configure MaxIdleConns and MaxIdleConnsPerHost for Azure backend --- tempodb/backend/azure/azure_helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tempodb/backend/azure/azure_helpers.go b/tempodb/backend/azure/azure_helpers.go index 1073b3caeb9..0533c76ead9 100644 --- a/tempodb/backend/azure/azure_helpers.go +++ b/tempodb/backend/azure/azure_helpers.go @@ -35,6 +35,10 @@ func GetContainerURL(ctx context.Context, cfg *Config, hedge bool) (blob.Contain } customTransport := http.DefaultTransport.(*http.Transport).Clone() + // Default MaxIdleConnsPerHost is 2, increase that to reduce connection turnover + customTransport.MaxIdleConnsPerHost = 200 + // set total max idle connections to a high number + customTransport.MaxIdleConns = 20000 // add instrumentation transport := instrumentation.NewTransport(customTransport) From e40e56795be8bba121484faa20a3bd22f46c2bfd Mon Sep 17 00:00:00 2001 From: Suraj Nath <9503187+electron0zero@users.noreply.github.com> Date: Thu, 18 Aug 2022 18:42:54 +0530 Subject: [PATCH 2/2] change max idle and per host connections to 100 --- tempodb/backend/azure/azure_helpers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tempodb/backend/azure/azure_helpers.go b/tempodb/backend/azure/azure_helpers.go index 0533c76ead9..8b27d03d963 100644 --- a/tempodb/backend/azure/azure_helpers.go +++ b/tempodb/backend/azure/azure_helpers.go @@ -36,9 +36,9 @@ func GetContainerURL(ctx context.Context, cfg *Config, hedge bool) (blob.Contain customTransport := http.DefaultTransport.(*http.Transport).Clone() // Default MaxIdleConnsPerHost is 2, increase that to reduce connection turnover - customTransport.MaxIdleConnsPerHost = 200 + customTransport.MaxIdleConnsPerHost = 100 // set total max idle connections to a high number - customTransport.MaxIdleConns = 20000 + customTransport.MaxIdleConns = 100 // add instrumentation transport := instrumentation.NewTransport(customTransport)