PHPackages                             plakhin/fpm-optimize - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. plakhin/fpm-optimize

ActiveLibrary

plakhin/fpm-optimize
====================

Suggests optimal php-fpm config values based on system config and load

v2.0.1(1y ago)1325MITPHPPHP ^8.3.0

Since Feb 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/plakhin/fpm-optimize)[ Packagist](https://packagist.org/packages/plakhin/fpm-optimize)[ GitHub Sponsors](https://github.com/plakhin)[ RSS](/packages/plakhin-fpm-optimize/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (13)Versions (6)Used By (0)

[![Screenshot of the `php artisan optimize:php-fpm` command](/art/optimize-php-fpm.png)](/art/optimize-php-fpm.png)

Optimal PHP-FPM config values based on system configuration and load
--------------------------------------------------------------------

[](#optimal-php-fpm-config-values-based-on-system-configuration-and-load)

[![Tests](https://github.com/plakhin/fpm-optimize/actions/workflows/tests.yml/badge.svg)](https://github.com/plakhin/fpm-optimize/actions/workflows/tests.yml)[![Latest Version on Packagist](https://camo.githubusercontent.com/44feb2f75c26e2823d13dc76943b9e626459e4cd1fa7c7a49e5e5dbdfbe0265e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706c616b68696e2f66706d2d6f7074696d697a652e737667)](https://packagist.org/packages/plakhin/fpm-optimize)[![Total Downloads](https://camo.githubusercontent.com/9e2e48e773b86952b43f5c4da01e6e89082c864121f27fc3dc8f47853186fea3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706c616b68696e2f66706d2d6f7074696d697a652e737667)](https://packagist.org/packages/plakhin/fpm-optimize)

Important

Since v2.0 only Linux is supported.

This package determines the number of system CPU cores, available RAM, and average RAM usage per PHP-FPM pool worker process. It then calculates the opinionated optimal values for PHP-FPM pool configuration, such as:

- `pm.max_children`
- `pm.start_servers`
- `pm.min_spare_servers`
- `pm.max_spare_servers`

**Don't forget to keep an eye on your `php-fpm.log` to avoid failures!**

Installation &amp; Usage
------------------------

[](#installation--usage)

Important

Ensure that your server is operating normally and serving incoming requests before executing the package command. This command takes into account the available RAM and the average RAM usage per PHP-FPM pool worker process to calculate values.

**The most simple way** to get the optimal PHP-FPM config values suggestions is to run the following command:

```
sh
