您好,欢迎访问一九零五行业门户网

Stark

stark starkis a library for running php code as multi-process daemon.
requires php 5.3 or higher a posix compatible operating system (linux, osx, bsd) posix and pcntl extensions for php features simple callbacks daemon monitoring automatic restart usage we just need only one script file and one config file. the php script file defines the callback functions. the ini config file defines daemon's enviroments. you can use this command to start you daemon:
php src/stark/run.php -f [ini_config_file]
daemon configuration main.name : a string specifying the daemon's unique name main.host : a string specifying the bind ip address of monitoring server main.port : an integer value specifying the bind port of monitoring server. main.working_dir : a path to a directory where the daemon should put its log file and socket file. run.script_file : the file that defines the callback funtions. run.memory_limit : specified as the php shorthand notation for bytes (see the manual ). this will be set asmemory_limitviaini_set worker.count : an integer value specifying the number of worker. worker.max_run_count : the maximum number of runs, after the number reached the worker will restart every time. worker.max_run_seconds : an integer value in seconds, specifying the maximum time the worker will restart after the time arrives. worker.max_idle_seconds : an integer value in seconds, specifying the longest idle time, the worker will restart after the time arrives. an example configuration ini file:
[main]name = config_1host = 127.0.0.1port = 9003working_dir = /tmp[run]script_file = run_1.phpmemory_limit = 1024m[worker]count = 3max_run_count = 10000max_run_seconds = 3600max_idle_seconds = 60
an example callback file: index} current: {$g_count}\r\n; usleep(100000);}
项目主页:http://www.open-open.com/lib/view/home/1436863173271
其它类似信息

推荐信息