Tune PHP-FPM Performance

Auto-detect from server

  1. Run auto-detection (requires server to be configured via server:add-project):

    gon tune --auto

    Reads CPU/RAM from the server and writes optimal values to gon.json.

  2. Review the generated config:

    cat docker/php-fpm-production.conf
  3. Deploy to apply:

    scp docker/php-fpm-production.conf root@server:/opt/myapp/docker/
    ssh root@server "cd /opt/myapp && docker compose restart app"

Manual tuning

  1. Edit gon.json performance section:

    {
    "performance": {
    "pm.max_children": 30,
    "pm.start_servers": 8
    }
    }
  2. Regenerate config:

    gon tune