Skip to content

Instantly share code, notes, and snippets.

@vmenajr
Last active March 10, 2021 05:06
Show Gist options
  • Save vmenajr/8209a97f79c1e8817b5722c29db07478 to your computer and use it in GitHub Desktop.
Save vmenajr/8209a97f79c1e8817b5722c29db07478 to your computer and use it in GitHub Desktop.
MongoDB Ubuntu 16.04 sticky ulimits
# system maximum
cat /proc/sys/fs/file-max
# available limit
ulimit -n
# Increase system-wide limit in /etc/sysctl.conf
fs.file-max = 200000
# Refresh
sudo sysctl -p
# Modify limits in /etc/security/limits.conf
mongodb soft nproc 200000
mongodb hard nproc 200000
mongodb soft nofile 200000
mongodb hard nofile 200000
mongodb soft memlock 2048
mongodb hard memlock 2048
# Enable limits.conf processing in /etc/pam.d/common-session
session required pam_limits.so
#Log out/in to get the changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment