php-cgi-spawner is the smallest and easiest application to spawn a multiple
php-cgi processes in Windows for your web server with FastCGI.
- It spawns as many
php-cgi(x86 or x64) on a single port as you need
- It automatically restarts them if they crashed or reached
If you have the following directory structure:
php-cgi-spawner.exe php php-cgi.exe php.ini
In order to spawn 4
php-cgi on tcp/9000:
php-cgi-spawner.exe php/php-cgi.exe 9000 4
You may specify a config file explicitly:
php-cgi-spawner.exe "php/php-cgi.exe -c php/php.ini" 9000 4
php-cgi.exe processes are spawned under the same user that runs
Now you can additionally specify a number of
php-cgi helpers for permanently running
php-cgi-spawner.exe "php/php-cgi.exe -c php/php.ini" 9000 4+16
It means that up to 16
php-cgi helpers can start automatically when 4
php-cgi permanents do not handle a temporary server high load.
php-cgi helpers can be set in
set PHP_HELP_MAX_REQUESTS 100 php-cgi-spawner.exe "php/php-cgi.exe -c php/php.ini" 9000 4+16
You can even do not use permanently running
php-cgi and use just helpers, even with 1 request per helper:
set PHP_HELP_MAX_REQUESTS 1 php-cgi-spawner.exe "php/php-cgi.exe -c php/php.ini" 9000 0+16
But it is recommended to run at least 1 permanent
php-cgi to handle opcache.
Go to release to download pre-built binary.
- Currently a maximum number of permanently running
php-cgiprocesses is 64 because of
- The number of
php-cgihelpers does not have such limit.