MongoDB Documentation, Release 3.0.4 Linux distributions using systemd /proc File System For Linux distributions that use systemd , you can specify limits within the [Service] sections of service scripts if you start mongod and/or mongos instances as systemd services. You can do this by using resource limit direc- tives$^{117}$. Specify the Recommended ulimit Settings (page 289), as in the following example: Each systemd limit directive sets both the “hard” and “soft” limits to the value specified. After after changing limit stanzas, ensure that the changes take effect by restarting the application services, using the following form: Note: This section applies only to Linux operating systems. The /proc file-system stores the per-process limits in the file system object located at /proc/<pid>/limits , where <pid> is the process’s PID or process identifier. You can use the following bash function to return the content of the limits object for a process or processes with a given name: You can copy and paste this function into a current shell session or load it as part of a script. Call the function with one the following invocations: $^{117}$http://www.freedesktop.org/software/systemd/man/systemd.exec.html#LimitCPU= return -limits(){ for process in $@; do process_pids=`ps -C $process -o pid --no-headers | cut -d " " -f 2` if [ -z $@ ]; then echo "[no $process running]" else for pid in $process_pids; do echo "[$process #$pid -- limits]" cat /proc/$pid/limits done fi done } systemctl restart <service name> [Service] # Other directives omitted # (file size) LimitFSIZE=infinity # (cpu time) LimitCPU=infinity # (virtual memory size) LimitAS=infinity # (open files) LimitNOFILE=64000 # (processes/threads) LimitNPROC=64000 Chapter 5. Administration 290