# PHP-FPM causing server to crash with massive CPU spikes on very small WordPress websites

**URL:** <https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109>\
**Category:** Virtualmin\
**Created:** [July 20, 2022, 4:44pm UTC](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109 "2022-07-20T16:44:29Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![hescominsoon](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/hescominsoon/32/2358_2.png) [@hescominsoon](https://forum.virtualmin.com/u/hescominsoon)\
**Post date:** [August 14, 2022, 7:17pm UTC](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109/42 "2022-08-14T19:17:56Z")

</div>

whew…that’s what i though about the separate pool for each one…i mid read things…🙂

---

<div class="post-metadata">

**Author:** ![dougtracey](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/dougtracey/32/3282_2.png) [@dougtracey](https://forum.virtualmin.com/u/dougtracey)\
**Post date:** [August 15, 2022, 8:53am UTC](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109/43 "2022-08-15T08:53:38Z")

</div>

That’s amazing @Dibs great work on finding these issues. I’ve now moved Snagging Company to its own server with a new hosting company I have found to be great value running AlmaLinux 8.6 with PHP 8 (settings below), which is absolutely flying now!..but it’s a 6vCPU VPS with 24GB of memory (for £28+VAT, that isn’t bad for this client as for my SEO work the speed is critical), so massive power for 1x WordPress website running WooCommerce, but still spiking and using all resources, so I will take a look at your recommendations above! If they work, I can move a few of my production sites over to this server as well!

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/5/5613dd464d1315e24ef1d6ed89da0e2b38e64adf.jpeg)

pm = dynamic  
pm.max\_children = 20  
pm.start\_servers = 1  
pm.min\_spare\_servers = 1  
pm.max\_spare\_servers = 5  
php\_value[max\_execution\_time] = 300  
php\_admin\_value[memory\_limit] = 256M  
php\_admin\_value[post\_max\_size] = 64M  
php\_admin\_value[upload\_max\_filesize] = 64M  
php\_admin\_value[max\_input\_time] = 120  
php\_value[file\_uploads] = On

---

<div class="post-metadata">

**Author:** ![dougtracey](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/dougtracey/32/3282_2.png) [@dougtracey](https://forum.virtualmin.com/u/dougtracey)\
**Post date:** [August 18, 2022, 12:23pm UTC](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109/44 "2022-08-18T12:23:49Z")

</div>

Sorry for going quiet for so long and for showing a very lazy workaround that didn’t exactly resolve the issue.

@Dibs, would you mind breaking down your fix a bit more for me? I renamed www.conf to www.conf.template on a test server, but that crashed everything when I restarted php-fpm. My production server is still getting smashed by excessive resource usage, which has caused a couple more minor site outages.

---

<div class="post-metadata">

**Author:** ![Dibs](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@Dibs](https://forum.virtualmin.com/u/Dibs)\
**Post date:** [August 18, 2022, 12:59pm UTC](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109/45 "2022-08-18T12:59:32Z")

</div>

@dougtracey - I went into all the numeric pool files and wrote down a little table (columns being)

- Pool File Name (the numeric number)
- User (in numeric pool file)
- Group (in numeric pool file)
- Port (in numeric pool file)
- Apache Port(left this blank for now).

Then went into /etc/apache2/sites-available and looked in each conf file and looked for the line that said:

`SetHandler proxy:fcgi://localhost:8002` or whatever port number is in use and filled in the “Apache Port” in my table.

This was just to make sure that everything matched and all the Virtual Servers (are\were) using php-fpm, had unique ports (which they should) and had a matching port number set in each Apache conf file.

Once confirmed (that no Virtual Server was using the www.conf file & had it’s own numeric pool file) - it was just a simple case of renaming www.conf to www.conf.template using a `mv` command.

In a nutshell - all my virtual servers are using a unique port and yet I was seeing an entry in `top` for php-fpm for a user `www-data` (which shouldn’t have been there) and tracked it down to a line in `etc/php/php7.4/fpm/php-fpm.conf`

`include=/etc/php/7.4/fpm/pool.d/*.conf`

i.e. it was firing up a pool for a “config” that was a leftover from the default php-fpm setup\install - where every everything runs under one user\pool (www-data or something) but multiple processes obviously.

Hope it makes sense.

Dibs

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [October 17, 2022, 1:00pm UTC](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109/46 "2022-10-17T13:00:00Z")

</div>

Closed on October 17, 2022, 1:00pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

[Previous page](https://forum.virtualmin.com/t/php-fpm-causing-server-to-crash-with-massive-cpu-spikes-on-very-small-wordpress-websites/116109.md?page=2)
