mirror of
https://github.com/minio/minio.git
synced 2025-04-08 21:55:44 -04:00
Add a reasonable if unable to get total RAM (#10506)
Though unlikely we shouldn't skip initializing the API if we cannot get RAM. Add 16GiB as a default and log the error.
This commit is contained in:
parent
84bf4624a4
commit
5ad032826a
@ -22,6 +22,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/minio/minio/cmd/config/api"
|
"github.com/minio/minio/cmd/config/api"
|
||||||
|
"github.com/minio/minio/cmd/logger"
|
||||||
"github.com/minio/minio/pkg/sys"
|
"github.com/minio/minio/pkg/sys"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -45,7 +46,9 @@ func (t *apiConfig) init(cfg api.Config, setDriveCount int) {
|
|||||||
if cfg.RequestsMax <= 0 {
|
if cfg.RequestsMax <= 0 {
|
||||||
stats, err := sys.GetStats()
|
stats, err := sys.GetStats()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
logger.LogIf(GlobalContext, err)
|
||||||
|
// Default to 16 GiB, not critical.
|
||||||
|
stats.TotalRAM = 16 << 30
|
||||||
}
|
}
|
||||||
// max requests per node is calculated as
|
// max requests per node is calculated as
|
||||||
// total_ram / ram_per_request
|
// total_ram / ram_per_request
|
||||||
|
Loading…
x
Reference in New Issue
Block a user