mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-13 13:11:37 +01:00
lib/netutil: increase dial timeout from 1 second to 5 seconds
There are real-world cases when TCP connection needs more than 1 second to be established.
This commit is contained in:
parent
c738739494
commit
e2d12a25e0
@ -15,7 +15,11 @@ import (
|
|||||||
func NewTCPDialer(name, addr string) *TCPDialer {
|
func NewTCPDialer(name, addr string) *TCPDialer {
|
||||||
d := &TCPDialer{
|
d := &TCPDialer{
|
||||||
d: &net.Dialer{
|
d: &net.Dialer{
|
||||||
Timeout: time.Second,
|
// The timeout for establishing a TCP connection.
|
||||||
|
// 5 seconds should be enough for the majority of cases.
|
||||||
|
Timeout: 5 * time.Second,
|
||||||
|
|
||||||
|
// How frequently to send keep-alive packets over established TCP connections.
|
||||||
KeepAlive: time.Second,
|
KeepAlive: time.Second,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user