PHPackages                             xingwenge/multi-process - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xingwenge/multi-process

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xingwenge/multi-process
=======================

Multi-process task manager.

v1.0.2(4y ago)151MITPHPPHP &gt;=7.1

Since Nov 2Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xingwenge/multi-process)[ Packagist](https://packagist.org/packages/xingwenge/multi-process)[ RSS](/packages/xingwenge-multi-process/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

multi-process
=============

[](#multi-process)

基于swoole实现的多进程管理器，类似于supervisor.

为什么要写multi-process
==================

[](#为什么要写multi-process)

php环境不用搭建其他多进程管理器
-----------------

[](#php环境不用搭建其他多进程管理器)

能够基于php的环境实现多进程管理，而不另外搭建其他多进程管理服务

php长进程存在的风险
-----------

[](#php长进程存在的风险)

基于php实现的长进程脚本，大部分业务是基于I/O的消息阻塞。

长时间运行的程序存在隐患

- 程序不当或者扩展带来的内存泄漏，长时间运行会导致内存溢出
- php程序依赖的服务代码有更新，业务功能不能及时更新

长进程程序能自重启能有效解决上述风险

引入使用
====

[](#引入使用)

```
# git clone git@github.com:xingwenge/multi-process.git
# cd multi-process
# composer update
# cd bin

```

or

```
# composer require xingwenge/multi-process
# mkdir multi-process && cd multi-process
# cp -r ../vendor/xingwenge/multi-process/bin/* .
```

运行demo
------

[](#运行demo)

```
// 修改demo 进程任务. redis连接配置、队列名称
# vi ./demo/redis-queue-pop.php          // redis 队列推送
# vi ./demo/redis-queue-push.php         // redis I/O阻塞，队列拉取

// 修改 config.yaml 配置文件，配置进程运行路径

// 运行demo.
# php ./multiprocessd -c config.yaml

// 推送数据到队列
# php ./demo/redis-queue-push.php

// 平滑结束
# php ./multiprocessctl -c config.yaml -s quit

// 停止
# php ./multiprocessctl -c config.yaml -s stop
```

依赖
==

[](#依赖)

- swoole

示例程序
====

[](#示例程序)

配置文件 `./bin/config.yaml`

```
settings:
  workDir: /tmp/multi-process          # 工作目录，存放进程id、日志

programs:
  Demo:                                 # 进程名称
    bin: /usr/local/php/bin/php         # 进程运行路径
    binArgs:                            # 参数
      - /data/www/multiprocess/bin/demo/redis-queue-pop.php
    startSecs: 3                        # 进程运行最小时长
    startRetries: 3                     # 程序运行失败重试的最大次数
```

启动 `./bin/multiprocessd -c ./bin/config.yaml`

平滑结束 `./bin/multiprocessctl -c ./bin/config.yaml -s quit`

停止 `./bin/multiprocessctl -c ./bin/config.yaml -s stop`

通过进程管理器创建的进程，阻塞拉取redis队列，并显示消息

[![示例运行效果图](assets/effect.gif)](assets/effect.gif)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1656d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10755609?v=4)[xingwenge](/maintainers/xingwenge)[@xingwenge](https://github.com/xingwenge)

---

Top Contributors

[![xingwg](https://avatars.githubusercontent.com/u/1069797?v=4)](https://github.com/xingwg "xingwg (39 commits)")[![xingwenge](https://avatars.githubusercontent.com/u/10755609?v=4)](https://github.com/xingwenge "xingwenge (1 commits)")

---

Tags

swoolemulti-process

### Embed Badge

![Health badge](/badges/xingwenge-multi-process/health.svg)

```
[![Health](https://phpackages.com/badges/xingwenge-multi-process/health.svg)](https://phpackages.com/packages/xingwenge-multi-process)
```

###  Alternatives

[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
