php cgi spawner,金哥/php-cgi-spawner

php-cgi-spawner

6f2rqvltmp9ax4nd?svg=true

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 PHP_FCGI_MAX_REQUESTS

Basic Usage

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 php-cgi-spawner.exe.

Version 1.1

Now you can additionally specify a number of php-cgi helpers for permanently running php-cgi processes:

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_FCGI_MAX_REQUESTS for php-cgi helpers can be set in PHP_HELP_MAX_REQUESTS:

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.

Download

Go to release to download pre-built binary.

Build

Go to src directory and run make.bat in a Visual Studio environment.

Notes

Currently a maximum number of permanently running php-cgi processes is 64 because of MAXIMUM_WAIT_OBJECTS in WaitForMultipleObjects.

The number of php-cgi helpers does not have such limit.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值