Reputation: 17214
Using trial and error, I've found the maximum number I can give to ulimit -Hn
without getting error is 1048576
. Where does that number come from? My sys.fs.file-max
is 20000500
(20 million).
Upvotes: 3
Views: 2780
Reputation: 14811
Actually, this is hardcoded in Linux kernel, in fs/file.c
:
int sysctl_nr_open __read_mostly = 1024*1024;
and is equal to just the number you specified.
Related commits that tried to make it infinite:
Looks like it hasn't been touched ever since.
Upvotes: 4
Reputation: 56
Actually, this limit can be increased. Set fs.nr_open=5242880
in /etc/sysctl.conf
, run sysctl -p
and login again. Your limit is now
5 million! Set both this and file-max.
Upvotes: 4