瀏覽代碼

Limit max open fds to 20K.

master
Arun Prakash Jana 8 年之前
父節點
當前提交
be77094235
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: A75979F35C080412
共有 1 個文件被更改,包括 9 次插入3 次删除
  1. +9
    -3
      nnn.c

+ 9
- 3
nnn.c 查看文件

@@ -246,10 +246,16 @@ max_openfds()
rl.rlim_cur = rl.rlim_max;

/* Return ~75% of max possible */
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
return (rl.rlim_max - (rl.rlim_max >> 2));
if (setrlimit(RLIMIT_NOFILE, &rl) == 0) {
limit = rl.rlim_max - (rl.rlim_max >> 2);
/*
* 20K is arbitrary> If the limit is set to max possible
* value, the memory usage increases to more than double.
*/
return limit > 20480 ? 20480 : limit;
}

return 32;
return limit;
}

/*


Loading…
取消
儲存