Skip to content
zefıly

PHP-FPM pool size calculator

Enter the RAM of your server, the memory kept for the operating system and other services, and the average size of one PHP process. The tool shows a conservative pm.max_children and the matching dynamic or ondemand settings, with the formula it used.

How it is calculated

    Pool settings
    
            

    Runs in your browser. Nothing you type here is sent to Zefily or stored.

    How to use it

    1. 1

      Enter the total RAM in MB, the memory reserved for the system, database and other services, and the number of PHP pools that share it.

    2. 2

      Measure the average PHP process size under real traffic, and enter it in MB. Keep the safety margin at 20 percent unless you know your peaks.

    3. 3

      Choose dynamic for busy sites or ondemand for small ones, then copy the pool settings into the pool file.

    Questions

    What is pm.max_children?

    It is the most PHP worker processes the pool may run at the same time. Each request uses one worker, so more workers serve more requests in parallel, but every worker takes memory. When all workers are busy, new requests wait in the queue.

    How do I measure the average process size?

    While the site is busy, run ps -ylC php-fpm --sort:rss, or look at the RES column in top. Average the RSS values in KB and divide by 1024 for MB. Measure under real traffic, because heavy pages or imports can use several times the average.

    What is the difference between dynamic and ondemand?

    dynamic keeps a set number of idle workers ready, so the first requests after a quiet period are faster. ondemand starts workers only when they are needed and stops them after an idle timeout, which saves memory on small or quiet sites.

    Why keep a 20 percent safety margin?

    Process sizes vary and traffic peaks. The margin keeps memory free for the database, caches and the operating system, so a spike slows the site down instead of pushing the server into swap or killing processes. Splitting the memory across several pools is also counted.

    Zefily does this for you on your servers

    Connect a server and Zefily sets up cron jobs, permissions, redirects, PHP pools and robots rules for your sites, then keeps them in place.

    Start free

    Black Friday & Cyber Monday

    Before you go: lifetime plans are on sale

    Pay once for a lifetime plan, or get 30% off the first year of any yearly plan.

    Only 100 lifetime plans per plan. When they are gone, they are gone.

    See the campaign

    Amazing November

    See the campaign →