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:
Harshavardhana
2016-07-30 08:50:49 -07:00
committed by Anand Babu (AB) Periasamy
parent 5b86dd7659
commit 8d090a20ce
3 changed files with 42 additions and 1 deletions

View File

@@ -24,3 +24,8 @@ func setMaxOpenFiles() error {
// (well, you do but it is based on your resources like memory).
return nil
}
func setMaxMemory() error {
// TODO: explore if Win32 API's provide anything special here.
return nil
}