title: Apache Max Connections
body: <p>we are using Ubuntu 16 LTS as a webserver with apache2.4, 18GB RAM and 20 cpus. I have issued following command</p>
  
  <pre><code>$ ulimit -a
  core file size          (blocks, -c) 0
  data seg size           (kbytes, -d) unlimited
  scheduling priority             (-e) 0
  file size               (blocks, -f) unlimited
  pending signals                 (-i) 72012
  max locked memory       (kbytes, -l) 64
  max memory size         (kbytes, -m) unlimited
  open files                      (-n) 1024
  pipe size            (512 bytes, -p) 8
  POSIX message queues     (bytes, -q) 819200
  real-time priority              (-r) 0
  stack size              (kbytes, -s) 8192
  cpu time               (seconds, -t) unlimited
  max user processes              (-u) 72012
  virtual memory          (kbytes, -v) unlimited
  file locks                      (-x) unlimited
  </code></pre>
  
  <p>Apache Version</p>
  
  <pre><code>$ apache2 -v
  Server version: Apache/2.4.18 (Ubuntu)
  Server built: 2018-04-18T14:53:04
  </code></pre>
  
  <p>Apache Module current in use</p>
  
  <pre><code>$ a2query -M
  prefork
  </code></pre>
  
  <p>and MPM prefork module is used with default settings</p>
  
  <pre><code>&lt;IfModule mpm_prefork_module&gt;
          StartServers             2
          MinSpareServers          5
          MaxSpareServers          10
          MaxRequestWorkers        400
          MaxConnectionsPerChild   0
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>I haved checked the maximum apache processes by JMeter stress tester and it doesnot expand more than 1500 processes. It is also checked that when 1500 processes are reached the RAM has still plenty of space (i.e. 9GB still remains).</p>
  
  <p>Process count is identified by following command</p>
  
  <pre><code>ps -ef | grep apache2 | wc -l
  </code></pre>
  
  <p>Guidance required to increase that 1500 number as we need to stick with MPM_prefork module.</p>