solving high CPU use by PHP-FPM
November 18, 2023 12:29PM
I have a dedicated virtual web server at AWS running Ubuntu with NGINX and PHP-FPM. Recently I started getting warnings in my PHP log about my pool being busy. For example:

[17-Nov-2023 20:08:14] WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers), spawning 8 children, there are 0 idle, and 29 total children

This is a low-traffic website running a small WordPress WooCommerce store. I've adjusted my configuration in www.conf but can't seem to solve this. PHP-FPM seems to be using more CPU than usual also. I"m wondering if there's some script or process in the WordPress site that's causing this but I'm having trouble confirming that or identifying the exact cause.

I've logged slow queries, looked at NGINX and PHP logs, used the Top command from the Ubuntu command line to watch PHP processes in real time, used Google Chrome inspector while loading website pages to see if there are any errors, and just today I set up the built-in PHP-FPM monitor.

What's the best way to zero in on what's causing this issue? Thank you.

Here's my current configuration for the www pool in www.conf:

pm.max_children = 60
pm.start_servers = 16
pm.min_spare_servers = 8
pm.max_spare_servers = 18

Server is an EC2 t3.medium instance (1 physical core, 4MB memory, 2 vCPUs)



Edited 1 time(s). Last edit at 11/18/2023 12:34PM by Megunticook.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 177
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready