mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00: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:
1 parent
f1cab828ee
commit
293d261cf9
4 files changed
+37
-12
No files matched your search
@@ -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