Skip to content

Commit 6d7f047

Browse files
authored
perf(worker): optimize the transport configuration of HTTP deliverer (#203)
1 parent 1d6c0df commit 6d7f047

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

worker/deliverer/http.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ type HTTPDeliverer struct {
1717
}
1818

1919
func NewHTTPDeliverer(cfg *config.WorkerDeliverer) *HTTPDeliverer {
20-
client := &http.Client{}
20+
client := &http.Client{
21+
Transport: &http.Transport{
22+
MaxIdleConns: 1000,
23+
MaxIdleConnsPerHost: 1000,
24+
IdleConnTimeout: 30 * time.Second,
25+
TLSHandshakeTimeout: 5 * time.Second,
26+
ExpectContinueTimeout: 1 * time.Second,
27+
},
28+
}
2129
return &HTTPDeliverer{
2230
defaultTimeout: time.Duration(cfg.Timeout) * time.Millisecond,
2331
client: client,

0 commit comments

Comments
 (0)