After updating MongoDB to Ubuntu 18/20, MongoDB reported "Soft rlimits too low: currentValue: 1024", but only when running as a service (not as a user).
How to fix has been answered, and the problem is resolved in answers for following questions Increasing nproc for processes launched by systemd on CentOS 7 and https://unix.stackexchange.com/questions/345595/how-to-set-ulimits-on-service-with-systemd (TL;DR; solution is to edit /etc/systemd/system/<servicename>.d/override.conf
or add limits direct to /lib/systemd/system/mongod.service
)
My questions are: where does that 1024 originally come from as it does not appear in any referenced places, and will this be affecting any other processes running as a service?
Where have I looked:
- /etc/security/limits.conf contains nothing; I have verified that (as
mentioned in answers) adding values here does not make a difference
when running as a service, but if running as the mongodb user, it
does work. This is not the source of the 1024.
- /etc/security/limits.d/ contains no files. I also confirmed that
adding values makes no difference.
- /etc/sysctl.conf (no fs.* references exit)
- /etc/pam.d/systemd-user (no references to limits in that file, or any included files)
- /proc/[pid]/limits confirms the 1024 (unless changed, where is confirmed numbers set by /etc/systemd/system/mongod.d/override.conf or /lib/systemd/system/mongod.service