Score:0

Where are default limits set for processes running as a service? (Ubuntu 18/20)

es flag

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:

  1. /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.
  2. /etc/security/limits.d/ contains no files. I also confirmed that adding values makes no difference.
  3. /etc/sysctl.conf (no fs.* references exit)
  4. /etc/pam.d/systemd-user (no references to limits in that file, or any included files)
  5. /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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.