ofcold / http-swoole
基于 Swoole 的高性能 HTTP 服务器。加速您的 Laravel 和 Lumen 应用程序。
dev-master
2020-02-15 04:46 UTC
Requires
- php: ^7.2
- illuminate/console: ~6.0
- illuminate/contracts: ~6.0
- illuminate/http: ~6.0
- illuminate/support: ~6.0
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.14.0
- laravel/lumen-framework: ~5.4|~6.0
- mockery/mockery: ~1.0
- php-coveralls/php-coveralls: ^2.1
- php-mock/php-mock: ^2.0
- phpunit/php-code-coverage: ^6.1
- phpunit/phpunit: ^7.5
- swoole/ide-helper: @dev
This package is auto-updated.
Last update: 2024-09-16 00:45:18 UTC
README
本软件包提供了一个高性能的 HTTP 服务器,基于 Swoole,以加速您的 Laravel/Lumen 应用程序。
版本兼容性
特性
- 在 Swoole 上运行 Laravel/Lumen 应用程序。
- 卓越的性能提升,速度高达 5倍。
- 沙箱模式以隔离应用程序容器。
- 支持在 Laravel 中运行 WebSocket 服务器。
- 支持
Socket.io
协议。 - 支持 Swoole 表以实现跨进程数据共享。
文档
请参阅 Wiki
基准测试
使用 DigitalOcean 3 个 CPU / 1 GB 内存 / PHP 7.2 / Ubuntu 16.04.4 x64 进行基准测试,测试干净 Lumen 5.6。
基准测试工具: wrk
wrk -t4 -c100 http://your.app
Nginx with FPM
wrk -t4 -c10 http://lumen-swoole.local
Running 10s test @ http://lumen-swoole.local
4 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 6.41ms 1.56ms 19.71ms 71.32%
Req/Sec 312.99 28.71 373.00 72.00%
12469 requests in 10.01s, 3.14MB read
Requests/sec: 1245.79
Transfer/sec: 321.12KB
Swoole HTTP Server
wrk -t4 -c10 http://lumen-swoole.local:1215
Running 10s test @ http://lumen-swoole.local:1215
4 threads and 10 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.39ms 4.88ms 105.21ms 94.55%
Req/Sec 1.26k 197.13 1.85k 68.75%
50248 requests in 10.02s, 10.88MB read
Requests/sec: 5016.94
Transfer/sec: 1.09MB
许可证
Laravel-Swoole 软件包是开源软件,使用 MIT 许可证 许可。