Skip to content
Snippets Groups Projects
Commit 96dc5502 authored by ale's avatar ale
Browse files

Increase the net/http IdleTimeout

parent 8be90307
No related branches found
No related tags found
No related merge requests found
...@@ -47,12 +47,15 @@ func Serve(h http.Handler, serverConfig *ServerConfig, addr string) (err error) ...@@ -47,12 +47,15 @@ func Serve(h http.Handler, serverConfig *ServerConfig, addr string) (err error)
} }
} }
// These are not meant to be external-facing servers, so we
// can be generous with the timeouts to keep the number of
// reconnections low.
srv := &http.Server{ srv := &http.Server{
Addr: addr, Addr: addr,
Handler: instrumentHandler(h), Handler: instrumentHandler(h),
ReadTimeout: 30 * time.Second, ReadTimeout: 30 * time.Second,
WriteTimeout: 30 * time.Second, WriteTimeout: 30 * time.Second,
IdleTimeout: 60 * time.Second, IdleTimeout: 600 * time.Second,
TLSConfig: tlsConfig, TLSConfig: tlsConfig,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment