Developer tool

PHP-FPM Pool Calculator

Estimate pm.max_children and related pool sizing from RAM, average worker usage, and reserve.

How it works

What it does

The PHP-FPM Pool Calculator estimates worker counts such as pm.max_children from total RAM, reserved system/other-service memory, and an assumed average PHP worker footprint. It shows the formula plainly so you can challenge assumptions instead of trusting a black box.

When to use it

  • A host swaps heavily under traffic
  • You are migrating from shared hosting defaults to a dedicated pool
  • Capacity planning before a campaign or product launch
  • Comparing “ondemand” vs “dynamic” mental models with real RAM math

How input is processed safely

All inputs are numbers and mode flags. Nothing connects to your FPM socket, nothing restarts services, and nothing inspects other sites on this machine. Output is advisory text plus a simple RAM visualization.

Examples

  • 4 GB RAM, 1 GB reserve, 64 MB average worker → bounded max_children
  • Heavy WordPress with page builders → higher assumed worker size
  • API with lean bootstrap → more children for the same RAM

Common mistakes

  • Using peak memory as if it were average forever
  • Ignoring MySQL/Redis RAM on the same box
  • Setting children so high that OOM kills master processes under load

The transparent formula exists so you can substitute better measurements later. If you know real average RSS from ps/metrics, use that instead of a guess. If MySQL shares the host, increase the reserve. If you run multiple pools, size them together rather than pretending each pool owns the entire machine.

Process manager mode changes behavior under idle and spike conditions. Dynamic pools keep spare workers; ondemand saves idle RAM but can add latency on cold starts; static is predictable for steady high traffic. The calculator’s RAM diagram is a planning aid, not a live monitor.

After changing pm.max_children, reload FPM carefully and watch latency, queue depth (if any), and OOM killer logs. Capacity planning is iterative.

Privacy note

Sizing needs host metrics, not customer data. Do not upload production heap dumps to third parties when a few numbers suffice.

Run in browser

AJAX processing only. No remote PHP execution sandbox. Results are not indexed.

Inputs are processed for this request only and are not stored in analytics. Object unserialize and arbitrary PHP execution are blocked.

Safety notes

  • Submitted tool contents are not written to analytics or search logs.
  • This site never evaluates arbitrary PHP from the browser.
  • Generated configs are starting points—validate on a staging host before production.