📖 ~1 min read
Table of contents
Symptom & Impact
Web requests fail intermittently and backend returns 502/504 errors.
Environment & Reproduction
Ubuntu 20.04 running Nginx with PHP-FPM during traffic spikes.
Root Cause Analysis
Pool worker settings exceed available memory and trigger process churn.
Quick Triage
Check php-fpm logs, process manager stats, and host memory usage.
Step-by-Step Diagnosis
Calculate worker memory footprint and reconcile pm.* values with RAM.

Solution – Primary Fix
Tune pool concurrency and memory limits, then restart php-fpm.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

Solution – Alternative Approaches
Split workloads into separate pools or scale app nodes horizontally.
Verification & Acceptance Criteria
Error rate drops and request latency remains stable at peak load.
Rollback Plan
Restore prior pool config if new limits reduce throughput excessively.
Prevention & Hardening
Track per-worker memory and tune automatically from observed baselines.
Related Errors & Cross-Refs
Kernel OOM events and swap thrash often accompany FPM instability.
Related tutorial: View the step-by-step tutorial for Ubuntu 18.04 LTS.
View all Ubuntu 18.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
PHP-FPM process manager tuning for Ubuntu production systems.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.