title: PHP5-FPM goes to 100% cpu usage and doesn't go down
body: <p>Please check the following image:</p>
  
  <p>Output of: <code>htop -u www-data</code></p>
  
  <p><a href="https://i.stack.imgur.com/afKNz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/afKNz.png" alt="htop -u www-data"></a></p>
  
  <p>My current configuration of <code>pool.d/www.conf</code> is:</p>
  
  <pre><code>pm = ondemand
  pm.max_children = 4
  pm.process_idle_timeout = 10s;
  pm.max_requests = 50
  </code></pre>
  
  <p>It's a 4 core cpu with 8gb ram. Ram usage is considerably less. If I have set max_children = 4, does that mean it there can be only 4 processes? (In screenshot, there are more than 8 php-fpm processes)</p>
  
  <p>And sometimes, it just stays at 100% in all 4 cores and website gives a 502 error till I restart php5-fpm.</p>