Permalink
Browse files

SERVER-25080 SERVER-24885: fix systemd process limits

  • Loading branch information...
1 parent 0b7ec44 commit 906a6f057f87fb4e51c4a698d9d6fe490fb293a2 @tychoish tychoish committed Aug 23, 2016
Showing with 9 additions and 0 deletions.
  1. +9 −0 debian/mongod.service
View
@@ -7,6 +7,15 @@ Documentation=https://docs.mongodb.org/manual
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
+LimitFSIZE=infinity # file size
+LimitCPU=infinity # cpu time
+LimitAS=infinity # virtual memory size
+LimitNOFILE=64000 # open files
+LimitNPROC=64000 # processes/threads
+TasksMax=infinity # total threads (user+kernel)
+TasksAccounting=false
+# Recommended limits for for mongod as specified in
+# http://docs.mongodb.org/manual/reference/ulimit/#recommended-settings
[Install]
WantedBy=multi-user.target

4 comments on commit 906a6f0

@tychoish this commit breaks majorly!

systemd reads the values literally and completely ignores the fact that "#" is a comment.

Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:10] Failed to parse resource value, ignoring: infinity # file size
Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:11] Failed to parse resource value, ignoring: infinity # cpu time
Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:12] Failed to parse resource value, ignoring: infinity # virtual memory size
Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:13] Failed to parse resource value, ignoring: 64000 # open files
Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:14] Failed to parse resource value, ignoring: 64000 # processes/threads
Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:15] Unknown lvalue 'TasksMax' in section 'Service'
Oct 01 14:35:15 hostname systemd[1]: [/lib/systemd/system/mongod.service:16] Unknown lvalue 'TasksAccounting' in section 'Service'
Member

tychoish replied Oct 3, 2016

I just did some testing of these values on one system, and I've not been able to reproduce this error yet, but I think that there may be something more happening with different versions of systemd, and I want to dig into this further.

I've created https://jira.mongodb.org/browse/SERVER-26438 to track this problem more closely, but I'd like more information about your set up, including (if possible) which distribution and operating system release, as well as and version of systemd you've observed this under.

Sorry for the problems, and we'll try and address this as quickly as possible.

Can be easily reproduces with this Vagrant box:

BASE_BOX = "debian/jessie64"
BASE_BOX_VERSION = "= 8.2.0"
vagrant@hostname:~$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 8 (jessie)"
NAME="Debian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"

Sorry don't have a JIRA account, please add it there.

Member

tychoish replied Oct 4, 2016

I tried to reproduce this issue on Debian 8.1 system built from the default Debian AMI on amazon, and was not able to reproduce this issue, although if you upgraded to this package from another package, it's possible that I've not reproduced your environment accurately.

It looks like the vagrant box version 8.2.0 was released on October 22, 2015, and there have been a number of updates to the "debian/jessie64" box since then. I'm not sure if this is a factor in the behavior that I'm observing.

I'm going to update the Jira ticket with some of this information, but if you have more context that might help us understand what's going on, that might be useful in getting to the bottom of this issue.

Sorry for the confusion.

Please sign in to comment.