gon tune
Generate PHP-FPM performance configuration for production. Reads settings from gon.json and outputs docker/php-fpm-production.conf.
Usage
gon tune # Generate config from gon.json (or defaults)gon tune --auto # Auto-detect optimal values from server specs
Auto-detection
With --auto, connects to the deploy server via SSH and reads:
- CPU cores (
nproc) - Available RAM (
free -m) - Current app memory usage (optional)
Calculates optimal pm.max_children based on 70% of available RAM / ~50MB per worker. Results are saved to gon.json.
gon.json configuration
{ "performance": { "pm": "dynamic", "pm.max_children": 20, "pm.start_servers": 5, "pm.min_spare_servers": 3, "pm.max_spare_servers": 10, "pm.max_requests": 500, "memory_limit": "512M", "opcache.memory_consumption": 256, "opcache.jit_buffer_size": "128M" }}
Generated file
docker/php-fpm-production.conf is mounted as a volume in production Docker compose. Changes take effect on container restart — no image rebuild needed.