A CLI tool that analyzes your system and calculates optimal FrankenPHP or PHP-FPM configuration.
curl -fsSL https://raw.githubusercontent.com/muuvmuuv/php-tuner/main/install.sh | shThen run:
./php-tuner # FrankenPHP (default)
./php-tuner fpm # PHP-FPMphp-tuner <command> [options]
Commands:
frankenphp, f FrankenPHP configuration (default)
php-fpm, fpm PHP-FPM configuration
help Show help
version Show version
php-tuner # Auto-detect
php-tuner f --traffic high # High-traffic profile
php-tuner f -c > config.txt # Export config onlyphp-tuner fpm # Auto-detect
php-tuner fpm --traffic high --pm static
php-tuner fpm -c > www.conf # Export config only| Flag | Description |
|---|---|
-c, --config-only |
Output only configuration |
--no-color |
Disable colors |
--traffic <level> |
low, medium, high |
--reserved <MB> |
Reserved memory for OS/Caddy |
--thread-mem <MB> |
Override thread memory estimate |
--worker=false |
Disable worker mode |
| Flag | Description |
|---|---|
-c, --config-only |
Output only configuration |
--no-color |
Disable colors |
--pm <type> |
static, dynamic, ondemand |
--traffic <level> |
low, medium, high |
--reserved <MB> |
Reserved memory for OS |
--process-mem <MB> |
Override process memory |
| Profile | FrankenPHP | PHP-FPM |
|---|---|---|
low |
Fewer threads | ondemand PM |
medium |
Balanced | dynamic PM |
high |
More threads, strict timeouts | static PM |
num_threads = min(CPU × 2, Available Memory / 30MB)
max_threads = CPU × 4
Based on Tideways' tuning guide:
max_children = (RAM - Reserved) / Process Memory
start_servers = CPU × 4
min_spare_servers = CPU × 2
max_spare_servers = CPU × 4
Requires Go 1.21+ and just
just build # Build
just run f # Build and run
just test # Run testsMIT