Skip to content

Commit

Permalink
perf(custom-proxy): disable keepalive to avoid 502 and timeout (#1860)
Browse files Browse the repository at this point in the history
Co-authored-by: kanesong <kanesong@tencent.com>
  • Loading branch information
songkane and kanesong committed Apr 24, 2022
1 parent 2fb3534 commit 7b2ebef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/platform/registry/cluster/storage/customresource_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ func (n *CustomResourceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
Host: strings.TrimPrefix(config.Host, "https://"),
})
reserveProxy.Transport = &http.Transport{
DisableKeepAlives: true,
DialContext: (&net.Dialer{
Timeout: 30 * time.Second,
Timeout: 5 * time.Second,
KeepAlive: 30 * time.Second,
}).DialContext,
MaxIdleConns: 100,
MaxIdleConns: 1000,
MaxIdleConnsPerHost: 100,
IdleConnTimeout: 90 * time.Second,
TLSHandshakeTimeout: 10 * time.Second,
ExpectContinueTimeout: 1 * time.Second,
Expand Down

0 comments on commit 7b2ebef

Please sign in to comment.