- 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
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.
Relevant content
- asked 10 months ago
