Quadruple all HTTP timeouts to prevent timeout errors
- HTTP request timeout: 2s -> 8s - Stats collection context timeout: 1s -> 4s - HTTP read header timeout: 10s -> 40s This should prevent timeout errors when the database is under load or when complex queries take longer than expected (slow query threshold is 50ms).
This commit is contained in:
@@ -42,7 +42,7 @@ func (s *Server) Start() error {
|
||||
port = "8080"
|
||||
}
|
||||
|
||||
const readHeaderTimeout = 10 * time.Second
|
||||
const readHeaderTimeout = 40 * time.Second
|
||||
s.srv = &http.Server{
|
||||
Addr: ":" + port,
|
||||
Handler: s.router,
|
||||
|
||||
Reference in New Issue
Block a user