title: Too many '/usr/sbin/apache2 -k start' processes
body: <p>I'm facing a problem with apache processes (/usr/sbin/apache2 -k start) visible in HTOP.
  <a href="https://i.stack.imgur.com/ZmJtu.png" rel="nofollow noreferrer">enter image description here</a>
  After every refresh or connection from a client the number of processes increase without stopping to run.
  Even if the browser is closed, the proces continues.
  In every php page with a connection to the database I end with:</p>
  <pre><code>    $thread_id = $mysqli-&gt;thread_id;
      $mysqli-&gt;kill($thread_id);
      $mysqli-&gt;close(); 
  </code></pre>
  <p>After a while my raspberry PI 3 is running very slow and actually too hot.
  I have a default installation of apache with the default settings.</p>
  <pre><code>Server version: Apache/2.4.38 (Raspbian)
  Server built:   2019-10-15T19:53:42
  Server's Module Magic Number: 20120211:84
  Server loaded:  APR 1.6.5, APR-UTIL 1.6.1
  Compiled using: APR 1.6.5, APR-UTIL 1.6.1
  Architecture:   32-bit
  Server MPM:     prefork
    threaded:     no
      forked:     yes (variable process count)
  Server compiled with....
   -D APR_HAS_SENDFILE
   -D APR_HAS_MMAP
   -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
   -D APR_USE_SYSVSEM_SERIALIZE
   -D APR_USE_PTHREAD_SERIALIZE
   -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
   -D APR_HAS_OTHER_CHILD
   -D AP_HAVE_RELIABLE_PIPED_LOGS
   -D DYNAMIC_MODULE_LIMIT=256
   -D HTTPD_ROOT=&quot;/etc/apache2&quot;
   -D SUEXEC_BIN=&quot;/usr/lib/apache2/suexec&quot;
   -D DEFAULT_PIDLOG=&quot;/var/run/apache2.pid&quot;
   -D DEFAULT_SCOREBOARD=&quot;logs/apache_runtime_status&quot;
   -D DEFAULT_ERRORLOG=&quot;logs/error_log&quot;
   -D AP_TYPES_CONFIG_FILE=&quot;mime.types&quot;
   -D SERVER_CONFIG_FILE=&quot;apache2.conf&quot;
  </code></pre>
  <p>In the mpm_prefork.conf file I have:</p>
  <pre><code>&lt;IfModule mpm_prefork_module&gt;
      StartServers        4
      MinSpareServers     1
      MaxSpareServers     4
      MaxRequestWorkers   50
      MaxConnectionsPerChild  0
  &lt;/IfModule&gt;
  </code></pre>
  <p>What can I do or set to automatically kill these processes after a client leaves the pages or closes the browser?
  Or are there any settings in apache to prevent this behaviour?</p>
  <p>Thanks in advance!</p>