Skip to content

Commit

Permalink
Set MaxIdleConns and MaxIdleConnsPerHost for Azure backend (#1632)
Browse files Browse the repository at this point in the history
* Configure MaxIdleConns and MaxIdleConnsPerHost for Azure backend

* change max idle and per host connections to 100
  • Loading branch information
electron0zero authored Aug 22, 2022
1 parent e0e47ad commit 627b1ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tempodb/backend/azure/azure_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 100
// set total max idle connections to a high number
customTransport.MaxIdleConns = 100

// add instrumentation
transport := instrumentation.NewTransport(customTransport)
Expand Down

0 comments on commit 627b1ee

Please sign in to comment.