mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05: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"
|
||||
|
||||
"github.com/minio/minio/cmd/config/api"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
"github.com/minio/minio/pkg/sys"
|
||||
)
|
||||
|
||||
@ -45,7 +46,9 @@ func (t *apiConfig) init(cfg api.Config, setDriveCount int) {
|
||||
if cfg.RequestsMax <= 0 {
|
||||
stats, err := sys.GetStats()
|
||||
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
|
||||
// total_ram / ram_per_request
|
||||
|
Loading…
Reference in New Issue
Block a user