mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
server: set globalCacheSize honoring system limits for max memory. (#2332)
On unix systems it is possible to set max memory used by running processes using 'ulimit -m' or 'syscall.RLIMIT_AS'. A process whence exceeds this limit, kernel would pro-actively kill such a server with OOM. To avoid this problem of defaulting our cache size to 8GB we should look for if the current system limits are lower and set the cache size appropriately.
This commit is contained in:
committed by
Anand Babu (AB) Periasamy
parent
5b86dd7659
commit
8d090a20ce
@@ -203,6 +203,11 @@ func initServerConfig(c *cli.Context) {
|
||||
// Set maxOpenFiles, This is necessary since default operating
|
||||
// system limits of 1024, 2048 are not enough for Minio server.
|
||||
setMaxOpenFiles()
|
||||
// Set maxMemory, This is necessary since default operating
|
||||
// system limits might be changed and we need to make sure we
|
||||
// do not crash the server so the set the maxCacheSize appropriately.
|
||||
setMaxMemory()
|
||||
|
||||
// Do not fail if this is not allowed, lower limits are fine as well.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user