diff --git a/internal/sarin/client.go b/internal/sarin/client.go index beaf5af..861105e 100644 --- a/internal/sarin/client.go +++ b/internal/sarin/client.go @@ -61,6 +61,7 @@ func NewHostClients( ReadTimeout: timeout, MaxResponseBodySize: safeUint64ToInt(maxResponseBody), MaxIdemponentCallAttempts: 1, + ReadBufferSize: 64 << 10, // 64 KiB DisableHeaderNamesNormalizing: true, DisablePathNormalizing: true, NoDefaultUserAgentHeader: true, @@ -85,6 +86,7 @@ func NewHostClients( ReadTimeout: timeout, MaxResponseBodySize: safeUint64ToInt(maxResponseBody), MaxIdemponentCallAttempts: 1, + ReadBufferSize: 64 << 10, // 64 KiB DisableHeaderNamesNormalizing: true, DisablePathNormalizing: true, NoDefaultUserAgentHeader: true, diff --git a/internal/sarin/scripthttp.go b/internal/sarin/scripthttp.go index 285b485..614c822 100644 --- a/internal/sarin/scripthttp.go +++ b/internal/sarin/scripthttp.go @@ -56,11 +56,11 @@ func newScriptHTTPClient( // Read and write timeouts stay unset because they would cap the per-call timeout, // so dialWithDeadline is what bounds the TLS handshake. return &fasthttp.Client{ - DialTimeout: dialWithDeadline(dial), - MaxConnsPerHost: safeUintToInt(maxConns), - MaxResponseBodySize: safeUint64ToInt(maxResponseBody), - // Retries would send one script call several times and hide it from the results. + DialTimeout: dialWithDeadline(dial), + MaxConnsPerHost: safeUintToInt(maxConns), + MaxResponseBodySize: safeUint64ToInt(maxResponseBody), MaxIdemponentCallAttempts: 1, + ReadBufferSize: 64 << 10, // 64 KiB TLSConfig: &tls.Config{ InsecureSkipVerify: insecure, //nolint:gosec },