- Newest
- Most votes
- Most comments
Hello.
I was able to find www.conf after installing Lightsail on my AWS account and then installing php-fpm8.2.
root@ip-172-26-3-107:~# find /etc/php -name "www.conf"
/etc/php/8.2/fpm/pool.d/www.conf
Can you check the system logs and application error logs for the time period when the application crashed?
If you're getting Out of Memory errors, it's likely due to insufficient memory, so adjusting the "max_children" value would be a reasonable solution.
While not limited to WordPress, I've attached a website that may be helpful for tuning php-fpm.
https://chrismoore.ca/2018/10/finding-the-correct-pm-max-children-settings-for-php-fpm/
https://serverfault.com/questions/939436/understand-correctly-pm-max-children-tuning
UPDATE:
A week ago, I ran ran/installed this:
sudo apt install php8.2-fpm php8.2-cli php8.2-common php8.2-mysql php8.2-zip php8.2-gd php8.2-mbstring php8.2-curl php8.2-xml
Then this:
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.2-fpm
sudo systemctl restart apache2
And haven't had a problem since.
I understand you're experiencing daily crashes with your WordPress instances after migrating from Bitnami to native Lightsail Debian 12 instances, and you're looking for the php-fpm www.conf file to adjust the pm.max_children setting.
For Debian 12 (bookworm) with PHP 8.2, the php-fpm pool configuration file is typically located at:
/etc/php/8.2/fpm/pool.d/www.conf
If you can't find it there, you can also check:
- /etc/php/8.2/fpm/php-fpm.d/www.conf
- Or run:
find /etc/php -name "www.conf"to locate it
Regarding the pm.max_children setting, you're correct that this is crucial for preventing memory exhaustion. With 1 GB RAM and a 2 GB swapfile, you'll want to be conservative with this setting. Each PHP-FPM child process typically uses 30-50 MB of memory, so with 1 GB RAM, you might want to set pm.max_children to around 10-15 to leave room for other processes.
Key settings to review in www.conf:
- pm.max_children (total number of child processes)
- pm.start_servers (number started at boot)
- pm.min_spare_servers (minimum idle processes)
- pm.max_spare_servers (maximum idle processes)
After making changes, restart php-fpm:
sudo systemctl restart php8.2-fpm
You should also monitor your memory usage with free -h and check PHP-FPM logs at /var/log/php8.2-fpm.log for any errors that might indicate what's causing the crashes.
The difference in stability between Bitnami and native instances could be due to different default PHP-FPM configurations, as Bitnami typically optimizes these settings for their stack.
I'm having the same issue on multiple sites - It's happening even on a landing page with a background and a form. I moved back to the bitnami instance and I'm having ZERO issues. Until this gets fixed I'll stick to it.
