Переглянути джерело

Limit max open fds to 20K.

master
Arun Prakash Jana 7 роки тому
джерело
коміт
be77094235
Не вдалося знайти GPG ключ що відповідає даному підпису Ідентифікатор GPG ключа: 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; rl.rlim_cur = rl.rlim_max;


/* Return ~75% of max possible */ /* Return ~75% of max possible */
if (setrlimit(RLIMIT_NOFILE, &rl) == 0) if (setrlimit(RLIMIT_NOFILE, &rl) == 0) {
return (rl.rlim_max - (rl.rlim_max >> 2)); 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;
} }


/* /*


||||||
x
 
000:0
Завантаження…
Відмінити
Зберегти