How this calculator works
Reserve memory for the OS, database and other services before applying a safety margin. Use measured worker memory from representative requests. CPU, request duration, shared pages and traffic patterns can impose tighter limits than RAM alone.
The formula
Worker budget = (total GiB − reserved GiB) × 1024 × (1 − margin/100). Workers = floor(budget / worker MiB).
A quick example
With 8 GiB total RAM, 2 GiB reserved, a 20% margin and 100 MiB per worker, the worker budget is 4,915.2 MiB and the estimate is 49 workers.
How to use this calculator
- Choose the settings that match your scenario, using the units shown beside each field.
- Enter total server ram (gib), reserved system and service ram (gib), measured average php worker memory (mib), safety margin on available ram (%).
- Calculate, then review the method and assumptions alongside the results.
A few common questions
Is this a guaranteed safe configuration?
What does pm.max_children limit?
Reference: PHP manual: PHP-FPM configuration