Dear all,
can you help me regarding the configuration of php-fpm with a Raspberry Pi 3B?
I’m running fpm with the default configuration and now wanted to know if I can optimize the pm settings.
Sysinfo:
Nextcloud version: 26.0.0
Operating system and version: Raspberry Pi OS 11
Apache or nginx version: Apache 2.4.56
PHP version: 8.1
Settings in pool.d/www.conf:
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
Now I will use this informations I found for FPM:
|max_children|(Total RAM – Memory used for Linux, DB, etc.) / process size
|start_servers|Number of CPU cores x 4
|min_spare_servers|Number of CPU cores x 2
|max_spare_servers|Same as start_servers
and my free -h:
total used free shared buff/cache available
Mem: 909Mi 235Mi 304Mi 58Mi 368Mi 555Mi
Swap: 99Mi 0B 99Mi
and the python script ps_mem.py:
$ sudo python ps_mem.py | grep php-fpm8.1
34.2 MiB + 57.3 MiB = 91.5 MiB php-fpm8.1 (4)
So I assume 235 Mi is the used RAM for the system?
Then I have for max_children: 909MB - 235 MB / 91.5 MB = 7,366…
RPi 3B has 4 cores, so my settings would be:
max_children = 7
start_servers = 16
min_spare_servers = 8
max_spare_servers = 16
If I try to restart php-fpm to apply these settings, I get an error saying max_children must not be lower than the servers.
Is there any mistake or isn’t it possible to optimize the settings and I shall stay with the default ones?