基于 Swoole 的动态多进程工作队列,类似 Gearman 但性能更高。
job scheduling component based on swoole; distributed task processing system similar to gearman;
redis/rabbitmq/zeromq and any other queue message store (currently only redis/rabbitmq).
use swoole process to realize multi process management, the number of processes can be configured, and the worker process will automatically pull up after exiting.
the number of cycles of child processes can be configured to prevent memory leakage from business code; the default stop command will wait for the child process to exit smoothly.
support topic features, different job binding different topic;
each topic starts the corresponding number of sub processes to eliminate the interaction between different topic.
according to the queue backlog, the sub process starts the process dynamically, and the number of the largest sub processes can be configured.
support composer, which can be integrated with any framework;
log file automatic cutting, default maximum 100M, up to 5 log files, prevent log brush full disk;
backlog, support for nail robot and other news alerts.
git clone https://github.com/kcloze/swoole-jobs.git
cd swoole-jobs
composer installphp ./bin/swoole-jobs.php start1.edit config.php
2.start service
php ./bin/swoole-jobs.php start >> log/system.log 2>&1
3.push jobs
php ./tests/testJobsSerialzie.php
4.start api server
php ./bin/swoole-jobs.php http start
5.stop api server
php ./bin/swoole-jobs.php http stop …| Params | Type | Demo |
|---|---|---|
| jobData | json | {"topic":"MyJob","jobClass":"\Kcloze\Jobs\Jobs\MyJob","jobMethod":"test2","jobParams":["kcloze",1532857253,"oop"],"jobExtras":[],"serializeFunc":"php"} |
* * * * * /usr/local/bin/php /***/swoole-jobs.php start >> /***/log/system.log 2>&1
1. According to your own project path, modify: docs/systemd/swoole-jobs.service
2. sudo cp -f systemd/swoole-jobs.service /etc/systemd/system/
3. sudo systemctl --system daemon-reload
4. Service management
#start service sudo systemctl start swoole-jobs.service #reload service sudo systemctl reload swoole-jobs.service #stop service sudo systemctl stop swoole-jobs.service
example/bin projects.qq group:141059677
暂无开放 Issues,或尚未同步最近议题。