/etc/security/limits.conf not applied
https://superuser.com/questions/1200539/cannot-increase-open-file-limit-past-4096-ubuntu/1200818#=
There's a bug since Ubuntu 16 apparently.
Basically:
- Edit
/etc/systemd/user.conf
for the soft limit, and addDefaultLimitNOFILE=1048576
. - Edit
/etc/systemd/system.conf
for the soft limit, and addDefaultLimitNOFILE=2097152
.
Credit goes to @mkasberg.
An alternative for those who prefer not to edit the default /etc/systemd/system.conf
and /etc/systemd/user/conf
files:
create a new file
/etc/systemd/system.conf.d/limits.conf
with these contents:[Manager] DefaultLimitNOFILE=1048576:2097152 DefaultLimitNPROC=262144:524288
run
systemctl daemon-reexec
as rootlogout and login again
check your new limits with either
ulimit -a
orulimit -n
andulimit -u
for max open files and max processes, respectively.
Refer to the systemd-system.conf
manpage for details.