0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 17:10:48 +01:00

SERVER-10931 set ulimits in init scripts to match documentation

This sets resource limits across all Linux packages to match our
recommended settings -
http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
This commit is contained in:
Ernie Hershey 2013-11-06 18:25:39 -05:00
parent eb1f40c7ef
commit 1b4c5d4f2c
3 changed files with 31 additions and 3 deletions

12
debian/init.d vendored
View File

@ -120,7 +120,17 @@ running() {
}
start_server() {
# Start the process using the wrapper
# Recommended ulimit values for mongod or mongos
# See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
#
ulimit -f unlimited
ulimit -t unlimited
ulimit -v unlimited
ulimit -n 64000
ulimit -m unlimited
ulimit -u 32000
# Start the process using the wrapper
start-stop-daemon --background --start --quiet --pidfile $PIDFILE \
--make-pidfile --chuid $DAEMONUSER \
--exec $NUMACTL $DAEMON $DAEMON_OPTS

10
debian/mongod.upstart vendored
View File

@ -1,6 +1,14 @@
# Ubuntu upstart file at /etc/init/mongod.conf
limit nofile 20000 20000
# Recommended ulimit values for mongod or mongos
# See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
#
limit fsize unlimited unlimited
limit cpu unlimited unlimited
limit as unlimited unlimited
limit nofile 64000 64000
limit rss unlimited unlimited
limit nproc 32000 32000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL.

View File

@ -45,6 +45,16 @@ fi
start()
{
# Recommended ulimit values for mongod or mongos
# See http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
#
ulimit -f unlimited
ulimit -t unlimited
ulimit -v unlimited
ulimit -n 64000
ulimit -m unlimited
ulimit -u 32000
echo -n $"Starting mongod: "
daemon --user "$MONGO_USER" $NUMACTL $mongod $OPTIONS
RETVAL=$?
@ -66,7 +76,7 @@ restart () {
start
}
ulimit -n 12000
RETVAL=0
case "$1" in