PHPackages                             swoft-rewrite/swoft-framework - 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. [Framework](/categories/framework)
4. /
5. swoft-rewrite/swoft-framework

ActiveLibrary[Framework](/categories/framework)

swoft-rewrite/swoft-framework
=============================

分布式开始，重写swoft框架之 -- framework 模块

01PHP

Since Jun 17Pushed 7y ago1 watchersCompare

[ Source](https://github.com/CoderShawnZhang/swoft-framework)[ Packagist](https://packagist.org/packages/swoft-rewrite/swoft-framework)[ RSS](/packages/swoft-rewrite-swoft-framework/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

swoft-framework
===============

[](#swoft-framework)

同步阻塞 如果用同步阻塞的写法，Worker进程必须要等待所有IO完成才能发送response，然后再处理下一个请求。一个请求要处理1秒，那4个Worker进程1秒只能处理4个请求。

所以同步模式应该增加进程数量，比如设置200个，那么就可以提供200QPS的处理能力。在swoole\_http\_server中如果使用同步模式编写代码，那么相比php-fpm，它提升性能的地方主要有2点：

swoole\_http\_server解析http请求效率更高，它是一次性读取所有SOCKET数据到内存，然后再去解析，比php-fpm的逐个read节省了大量系统调用，效率要更高。 swoole\_http\_server支持PHP对象和全局变量、资源持久化，所以不需要重复创建销毁某些对象/变量/资源，所以节省了很多CPU消耗。 异步非阻塞 swoole\_http\_server最大的优势是可以使用异步IO，假设一个请求需要花1秒，这1秒中有800ms是等待MySQL服务器返回数据。异步模式可以执行SQL后设置一个回调函数然后立即返回。这时并没有发送response，请求实际上是挂在EventLoop中的。

Server就可以直接处理下一个请求，同样下一个请求也是继续发送SQL然后设置回调。等MySQL服务器返回结果时，才重新把上一次的request拿出来，response内容拼好，然后发送response。

实际上一个request花的时间还是1秒，只不过异步模式下Server可以同时并发处理多个请求。所以4个进程就能应对大量请求。

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

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

---

Top Contributors

[![CoderShawnZhang](https://avatars.githubusercontent.com/u/4350258?v=4)](https://github.com/CoderShawnZhang "CoderShawnZhang (12 commits)")

### Embed Badge

![Health badge](/badges/swoft-rewrite-swoft-framework/health.svg)

```
[![Health](https://phpackages.com/badges/swoft-rewrite-swoft-framework/health.svg)](https://phpackages.com/packages/swoft-rewrite-swoft-framework)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k104.3M836](/packages/laravel-socialite)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k38.6M289](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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