[Pkg-mongodb-maintainers] Bug#857969: Set ulimit settings to recommended values

Joshua Powers josh.powers at canonical.com
Thu Mar 16 19:38:37 UTC 2017


Package: mongodb
Version: 3.4.1-3

MongoDB documentation [1] provides a set of ulimit settings to help
performance. One of these values, the maximum number of open files, for
example is set to 1024 in the OS. This is much lower than what MongoDB
suggests.

The below patch proposes increasing these limits to match the
recommended values.

[1] https://docs.mongodb.com/manual/reference/ulimit/#linux-distributions-using-systemd

diff --git a/debian/mongodb-server.mongodb.service b/debian/mongodb-server.mongodb.service
index 6eea70c..928d933 100644
--- a/debian/mongodb-server.mongodb.service
+++ b/debian/mongodb-server.mongodb.service
@@ -11,6 +11,11 @@ EnvironmentFile=-/etc/default/mongodb
 Environment=CONF=/etc/mongodb.conf
 Environment=SOCKETPATH=/run/mongodb
 ExecStart=/usr/bin/mongod --unixSocketPrefix=${SOCKETPATH} --config ${CONF} $DAEMON_OPTS
+LimitFSIZE=infinity
+LimitCPU=infinity
+LimitAS=infinity
+LimitNOFILE=64000
+LimitNPROC=64000
 
 [Install]
 WantedBy=multi-user.target


-- 
Joshua Powers
Ubuntu Server
Canonical Ltd



More information about the Pkg-mongodb-maintainers mailing list