mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
use available memory to restrict API calls (#13047)
also choose 90% of the available memory to calculate maximum API calls.
This commit is contained in:
@@ -20,6 +20,7 @@ package cmd
|
||||
import (
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/minio/minio/internal/logger"
|
||||
"github.com/minio/pkg/sys"
|
||||
)
|
||||
|
||||
@@ -41,6 +42,10 @@ func setMaxResources() (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if maxLimit < 4096 {
|
||||
logger.Info("WARNING: maximum file descriptor limit %d is too low for production servers. At least 4096 is recommended. Fix with \"ulimit -n 4096\"", maxLimit)
|
||||
}
|
||||
|
||||
if err = sys.SetMaxOpenFileLimit(maxLimit, maxLimit); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user