@@ -49,16 +49,16 @@ func NewClients(perHost int) (*Clients, error) {
4949 }
5050
5151 return & Clients {
52- General : & http.Client {Transport : genTr , Timeout : 20 * time .Second },
52+ General : & http.Client {Transport : genTr , Timeout : 30 * time .Second },
5353 Probe : & http.Client {
5454 Transport : probTr ,
5555 // for probes, prefer per-request context timeouts; keep a hard cap anyway
56- Timeout : 8 * time .Second ,
56+ Timeout : 12 * time .Second ,
5757 },
5858 Crawl : & http.Client {
5959 Transport : crwlTr ,
6060 // crawls can legitimately take longer. Use request contexts to bound if needed
61- Timeout : 45 * time .Second ,
61+ Timeout : 60 * time .Second ,
6262 Jar : jar ,
6363 },
6464 genTr : genTr ,
@@ -70,15 +70,15 @@ func NewClients(perHost int) (*Clients, error) {
7070func newGeneralTransport () * http.Transport {
7171 return & http.Transport {
7272 Proxy : http .ProxyFromEnvironment ,
73- DialContext : amassnet .NewDialContext (5 * time .Second ),
73+ DialContext : amassnet .NewDialContext (8 * time .Second ),
7474 ForceAttemptHTTP2 : true ,
7575 MaxIdleConns : 200 ,
7676 MaxIdleConnsPerHost : 20 ,
77- MaxConnsPerHost : 100 ,
77+ MaxConnsPerHost : 64 ,
7878 IdleConnTimeout : 90 * time .Second ,
79- TLSHandshakeTimeout : 5 * time .Second ,
80- ExpectContinueTimeout : 4 * time .Second ,
81- ResponseHeaderTimeout : 8 * time .Second ,
79+ TLSHandshakeTimeout : 8 * time .Second ,
80+ ExpectContinueTimeout : 1 * time .Second ,
81+ ResponseHeaderTimeout : 15 * time .Second ,
8282 // prefer correct TLS verification for APIs
8383 TLSClientConfig : & tls.Config {
8484 MinVersion : tls .VersionTLS12 ,
@@ -90,40 +90,39 @@ func newGeneralTransport() *http.Transport {
9090func newProbeTransport (perHost int ) * http.Transport {
9191 return & http.Transport {
9292 Proxy : http .ProxyFromEnvironment ,
93- DialContext : amassnet .NewDialContext (2 * time .Second ),
94- ForceAttemptHTTP2 : true ,
93+ DialContext : amassnet .NewDialContext (5 * time .Second ),
94+ ForceAttemptHTTP2 : false ,
9595 // keep this lower: probes spray across many hosts; idle pools become “memory”
96- MaxIdleConns : 100 ,
96+ MaxIdleConns : 64 ,
9797 MaxIdleConnsPerHost : perHost ,
9898 MaxConnsPerHost : perHost * 3 ,
99- IdleConnTimeout : 5 * time .Second ,
100- TLSHandshakeTimeout : 3 * time .Second ,
99+ IdleConnTimeout : 15 * time .Second ,
100+ TLSHandshakeTimeout : 6 * time .Second ,
101101 ExpectContinueTimeout : 0 ,
102- ResponseHeaderTimeout : 4 * time .Second ,
102+ ResponseHeaderTimeout : 8 * time .Second ,
103103 // often you’ll hit junk certs during probing; keep verification on by default.
104104 // if you *must* allow insecure probing, fork a separate transport with InsecureSkipVerify=true
105105 // but be intentional about it
106106 TLSClientConfig : & tls.Config {
107107 MinVersion : tls .VersionTLS12 ,
108108 },
109- DisableKeepAlives : true ,
110109 DisableCompression : true , // avoid spending CPU on gzip for tiny probe responses
111110 }
112111}
113112
114113func newCrawlTransport () * http.Transport {
115114 return & http.Transport {
116115 Proxy : http .ProxyFromEnvironment ,
117- DialContext : amassnet .NewDialContext (6 * time .Second ),
116+ DialContext : amassnet .NewDialContext (8 * time .Second ),
118117 ForceAttemptHTTP2 : true ,
119118 // crawling usually hits same hosts repeatedly; keep-alives pay off
120- MaxIdleConns : 512 ,
119+ MaxIdleConns : 256 ,
121120 MaxIdleConnsPerHost : 32 ,
122- MaxConnsPerHost : 128 ,
121+ MaxConnsPerHost : 96 ,
123122 IdleConnTimeout : 120 * time .Second ,
124- TLSHandshakeTimeout : 6 * time .Second ,
123+ TLSHandshakeTimeout : 8 * time .Second ,
125124 ExpectContinueTimeout : 1 * time .Second ,
126- ResponseHeaderTimeout : 12 * time .Second ,
125+ ResponseHeaderTimeout : 20 * time .Second ,
127126 TLSClientConfig : & tls.Config {
128127 MinVersion : tls .VersionTLS12 ,
129128 },
0 commit comments