[SERVER-28934] Mongo systemd service does not define nofiles Created: 24/Apr/17 Updated: 27/Oct/23 Resolved: 01/May/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Packaging |
| Affects Version/s: | 3.4.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Uri Harduf | Assignee: | Mark Agarunov |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | Linux | ||||||||
| Participants: | |||||||||
| Description |
|
The issue started after installing the latest mongo server, where the service of mongo has changed from mongod to mongodb, and the service was installed via /usr/lib/systemd and not under /etc/init. The problem is that the systemd service does not use the limits defined in /etc/security/limits.conf, and mongo starts with 1024 max open files, and easily crashes as it runs out of open files. Also generally systemd does not check /etc/security/limits.conf and you need to add LimitNOFILES to the service. |
| Comments |
| Comment by Mark Agarunov [ 01/May/17 ] | |
|
Hello uri.harduf, Thank you for providing this information. The behavior you are seeing is expected in environments running systemd. When systemd is used, as it is on Ubuntu 16.04, the open file limit is set by the LimitNOFILES directive in the mongod.service file, located at /lib/systemd/system/mongod.service on Ubuntu 16.04. By default, this is set to:
But can be increased if needed. Thanks, | |
| Comment by Uri Harduf [ 30/Apr/17 ] | |
| |
| Comment by Mark Agarunov [ 26/Apr/17 ] | |
|
Hello uri.harduf, Thank you for the report. We are investigating the behavior you've described, however I have a couple questions to help clarify this issue.
Thanks, |