title: MongoDB: soft rlimits too low. rlimits set to 27774 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files
body: <p>I have an Ubuntu server which is running on 14.04.05 LTS.</p>
  
  <p>There are several applications that is ugins mongodb installed also on this server. MongoDB version is 3.4.2</p>
  
  <p>I'm trying to increase max process ulimit of mongodb process.</p>
  
  <p>I first put these lines to <code>/etc/security/limits.conf</code></p>
  
  <p><code>
  *       soft        nproc      unlimited
  *       hard      nproc        unlimited
  *       soft       nofile      64000
  *       hard      nofile      64000
  *       soft    sigpending      unlimited
  *       hard    sigpending      unlimited
  root       soft        nproc        unlimited
  root       hard      nproc        unlimited
  root       soft       nofile      64000
  root       hard      nofile      64000
  root    soft    sigpending      unlimited
  root    hard    sigpending      unlimited
  mongodb       soft        nproc      unlimited
  mongodb       hard      nproc        unlimited
  mongodb       soft       nofile      64000
  mongodb       hard      nofile      64000
  mongodb soft    sigpending      unlimited
  mongodb hard    sigpending      unlimited
  </code></p>
  
  <p>and also put required pam.limits to proper locations and reboot but no success.</p>
  
  <p>Then i tried to manually run <code>ulimit -u unlimited</code> command which is reflected immediately after i executed it (i seen the result with <code>ulimit -a</code> command). And then reboot the mongodb process but the limits are didn't changed.</p>
  
  <p>Then i tried to put these lines to:</p>
  
  <p><code>
  ulimit -f unlimited
  ulimit -t unlimited
  ulimit -v unlimited
  ulimit -n 64000
  ulimit -m unlimited
  ulimit -u unlimited
  </code></p>
  
  <p>to <code>/etc/init.d/mongodb</code> file and try to start mongodb process with <code>/etc/init.d/mongodb start</code> but i got this error:</p>
  
  <p><code>/etc/init.d/mongodb: 67: ulimit: Illegal option -u</code></p>
  
  <p>I also put this line <code>mongod     soft    nproc     64000</code> to <code>/etc/security/limits.d/90-nproc.conf</code> and tried to reboot but no success.</p>
  
  <p>On this thread <code>https://stackoverflow.com/questions/9361816/maximum-number-of-processes-in-linux</code> i saw that one user reported about <code>kernel.threads-max</code> is limiting this number but on my another server i can get more max connection limit then <code>kernel.threads-max / 2</code></p>
  
  <p>So I'm not sure where do i doing wrong but any help is much appreciated.</p>