diff options
author | Kassio Borges <kborges@gitlab.com> | 2022-04-11 15:57:27 +0300 |
---|---|---|
committer | Kassio Borges <kborges@gitlab.com> | 2022-04-11 15:57:27 +0300 |
commit | f2792ec357dd90dcc4e4df929386c02929450999 (patch) | |
tree | b922d6eb88507e06530013db823f181188768ad3 | |
parent | 4b1afecbb6ae1886bfd3a31f256909ca2770bce4 (diff) |
Increase serverWriteTimeout to avoid errors with large files
Related to: https://gitlab.com/gitlab-org/gitlab-pages/-/issues/725
Changelog: fixed
-rw-r--r-- | internal/config/config.go | 4 | ||||
-rw-r--r-- | internal/config/flags.go | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index dbb88806..06e0520a 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -340,6 +340,10 @@ func LogConfig(config *Config) { "rate-limit-tls-source-ip-burst": config.RateLimit.TLSSourceIPBurst, "rate-limit-tls-domain": config.RateLimit.TLSDomainLimitPerSecond, "rate-limit-tls-domain-burst": config.RateLimit.TLSDomainBurst, + "server-read-timeout": config.Server.ReadTimeout, + "server-read-header-timeout": config.Server.ReadHeaderTimeout, + "server-write-timeout": config.Server.WriteTimeout, + "server-keep-alive": config.Server.ListenKeepAlive, }).Debug("Start Pages with configuration") } diff --git a/internal/config/flags.go b/internal/config/flags.go index a5d9c221..c2d315d1 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -85,7 +85,7 @@ var ( // HTTP server timeouts serverReadTimeout = flag.Duration("server-read-timeout", 5*time.Second, "ReadTimeout is the maximum duration for reading the entire request, including the body. A zero or negative value means there will be no timeout.") serverReadHeaderTimeout = flag.Duration("server-read-header-timeout", time.Second, "ReadHeaderTimeout is the amount of time allowed to read request headers. A zero or negative value means there will be no timeout.") - serverWriteTimeout = flag.Duration("server-write-timeout", 30*time.Second, "WriteTimeout is the maximum duration before timing out writes of the response. A zero or negative value means there will be no timeout.") + serverWriteTimeout = flag.Duration("server-write-timeout", 5*time.Minute, "WriteTimeout is the maximum duration before timing out writes of the response. A zero or negative value means there will be no timeout.") serverKeepAlive = flag.Duration("server-keep-alive", 15*time.Second, "KeepAlive specifies the keep-alive period for network connections accepted by this listener. If zero, keep-alives are enabled if supported by the protocol and operating system. If negative, keep-alives are disabled.") disableCrossOriginRequests = flag.Bool("disable-cross-origin-requests", false, "Disable cross-origin requests") |