Skip to content

Instantly share code, notes, and snippets.

@RaphaelAudet
Last active August 29, 2015 14:04
Show Gist options
  • Save RaphaelAudet/d5ce777883b651997ffd to your computer and use it in GitHub Desktop.
Save RaphaelAudet/d5ce777883b651997ffd to your computer and use it in GitHub Desktop.
set open file limit
#!/bin/bash
cp /etc/sysctl.conf /etc/sysctl.conf.20140808
echo 'fs.file-max = 64000'>>/etc/sysctl.conf
echo 'root soft nofile 64000'>>/etc/security/limits.conf
echo 'root hard nofile 64000'>>/etc/security/limits.conf
# echo 'mongodb soft nofile 64000'>>/etc/security/limits.conf
# echo 'mongodb hard nofile 64000'>>/etc/security/limits.conf
sysctl -p
ulimit -n 64000
echo 'session required pam_limits.so' >> /etc/pam.d/common-session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment