Skip to content

Instantly share code, notes, and snippets.

@mrrooijen
Created July 20, 2012 01:42
Show Gist options
  • Save mrrooijen/3148139 to your computer and use it in GitHub Desktop.
Save mrrooijen/3148139 to your computer and use it in GitHub Desktop.
ulimit hell.
# /etc/security/limits.conf
root - nofile 65000
deployer - nofile 65000
# Ubuntu upstart file at /etc/init/mongodb.conf
start on runlevel [2345]
stop on runlevel [016]
respawn
script
ulimit -n 65000
exec su - root -c "/etc/mongodb/bin/mongod --port '27017' --dbpath '/home/deployer/mongodb/db/mongodb27017' --journal" >> '/home/deployer/mongodb/log/mongodb27017.log' 2>&1
end script
# For /etc/init.d/<script> just add the following somewhere:
ulimit -n 65000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment