diff --git a/cmd/globals.go b/cmd/globals.go index 4efaff584..54c001494 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -64,8 +64,13 @@ const ( // Limit memory allocation to store multipart data maxFormMemory = int64(5 * humanize.MiByte) - // The maximum allowed difference between the request generation time and the server processing time - globalMaxSkewTime = 15 * time.Minute + // The maximum allowed time difference between the incoming request + // date and server date during signature verification. + globalMaxSkewTime = 15 * time.Minute // 15 minutes skew allowed. + + // Default Read/Write timeouts for each connection. + globalConnReadTimeout = 15 * time.Minute // Timeout after 15 minutes of no data sent by the client. + globalConnWriteTimeout = 15 * time.Minute // Timeout after 15 minutes if no data received by the client. ) var ( @@ -141,12 +146,9 @@ var ( globalObjectTimeout = newDynamicTimeout( /*1*/ 10*time.Minute /*10*/, 600*time.Second) // timeout for Object API related ops globalOperationTimeout = newDynamicTimeout(10*time.Minute /*30*/, 600*time.Second) // default timeout for general ops globalHealingTimeout = newDynamicTimeout(30*time.Minute /*1*/, 30*time.Minute) // timeout for healing related ops -) -var ( - // Keeps the connection active by waiting for following amount of time. - // Primarily used in ListenBucketNotification. - globalSNSConnAlive = 5 * time.Second + // Keep connection active for clients actively using ListenBucketNotification. + globalSNSConnAlive = 5 * time.Second // Send a whitespace every 5 seconds. ) // global colors. diff --git a/cmd/server-main.go b/cmd/server-main.go index 6d056163e..6534c4d60 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -193,6 +193,8 @@ func serverMain(ctx *cli.Context) { initGlobalAdminPeers(globalEndpoints) globalHTTPServer = miniohttp.NewServer([]string{globalMinioAddr}, handler, globalTLSCertificate) + globalHTTPServer.ReadTimeout = globalConnReadTimeout + globalHTTPServer.WriteTimeout = globalConnWriteTimeout globalHTTPServer.UpdateBytesReadFunc = globalConnStats.incInputBytes globalHTTPServer.UpdateBytesWrittenFunc = globalConnStats.incOutputBytes globalHTTPServer.ErrorLogFunc = errorIf