mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
server: Add connection rate limiter for server. (#1977)
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
57146fbbb8
commit
936a916e78
@@ -133,6 +133,14 @@ func initServerConfig(c *cli.Context) {
|
||||
err := serverConfig.Save()
|
||||
fatalIf(err, "Unable to save config.")
|
||||
|
||||
// Fetch max conn limit from environment variable.
|
||||
if maxConnStr := os.Getenv("MINIO_MAXCONN"); maxConnStr != "" {
|
||||
// We need to parse to its integer value.
|
||||
var err error
|
||||
globalMaxConn, err = strconv.Atoi(maxConnStr)
|
||||
fatalIf(err, "Unable to convert MINIO_MAXCONN=%s environment variable into its integer value.", maxConnStr)
|
||||
}
|
||||
|
||||
// Fetch access keys from environment variables if any and update the config.
|
||||
accessKey := os.Getenv("MINIO_ACCESS_KEY")
|
||||
secretKey := os.Getenv("MINIO_SECRET_KEY")
|
||||
|
||||
Reference in New Issue
Block a user