Skip to content

Commit

Permalink
Fix #34: use ~75% of max open file descs
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Jul 25, 2017
1 parent 75e3118 commit 16f0054
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,9 @@ max_openfds()
limit = rl.rlim_cur;
rl.rlim_cur = rl.rlim_max;

/* Return ~75% of max possible */
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
return rl.rlim_max - 64;

if (limit > 128)
return limit - 64;
return (rl.rlim_max - (rl.rlim_max >> 2));

return 32;
}
Expand Down

0 comments on commit 16f0054

Please sign in to comment.