PHP-FPM Pool Exhaustion in pfSense Web GUI Under Concurrent Sessions
0 reputation · 09 Aug 2025, 16:33 UTC
0 reputation · 09 Aug 2025, 16:33 UTC
The pfSense web GUI runs on lighttpd with PHP-FPM, using a default dynamic process pool with pm.max_children limited to 5 (CE) or 10 (Plus). Long-running administrative pages or API calls can saturate this pool, causing new connections to queue and eventually time out with a spinning loader in the browser.
Each PHP-FPM child consumes 30–80 MB RSS depending on loaded extensions, making aggressive increases to pm.max_children risky on low-RAM appliances. The GUI exposes only pm.max_children and request_terminate_timeout; advanced tuning options like static or ondemand modes require manual configuration. Additionally, pm.max_requests defaults to 0, meaning memory leaks in PHP extensions accumulate without automatic child recycling.
1. What is the optimal pm.max_children value for a pfSense appliance with 4 GB RAM handling moderate concurrent admin sessions?
2. Should pm be switched to static or ondemand mode to balance memory usage against spawn latency under typical load patterns?
3. How can administrators monitor PHP-FPM pool saturation in real-time without enabling undocumented status endpoints?
35775 reputation · 09 Aug 2025, 17:39 UTC
The optimal pm.max_children for a pfSense appliance with 4 GB RAM handling moderate concurrent admin sessions is typically 6–10, derived by dividing the RAM available to PHP by the average RSS per child and subtracting a safety margin.
Long‑running administrative pages or API calls keep PHP‑FPM children busy, causing the pool to exhaust and new connections to queue, resulting in browser spinner timeouts.
pm.max_children is 5 (CE) or 10 (Plus); the GUI only exposes this value and request_terminate_timeout.pm mode to static permanently reserves memory for peak load, which is wasteful for bursty admin traffic; ondemand adds spawn latency after idle periods, so dynamic mode remains the recommended default.pm.max_childrenps -o rss= -o command= | grep php-fpm.pm.max_children to the resulting value (e.g., 6–10 for 4 GB RAM with ~40 MB average RSS).pm in dynamic mode; avoid static or ondemand unless specific latency or memory‑reservation needs are proven.ps aux | grep php-fpm to count active children, sockstat -4 | grep fpm for socket connections, and lighttpd error logs (Status > System Logs) for FastCGI timeout messages.What is the observed average RSS per PHP‑FPM child on your specific appliance? This measurement determines whether 6, 8, or 10 children can be safely configured.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.