swooletw / laravel-swoole
High performance HTTP server based on Swoole. Speed up your Laravel and Lumen applications.
Installs: 714 718
Dependents: 10
Suggesters: 0
Security: 0
Stars: 4 044
Watchers: 112
Forks: 389
Open Issues: 40
Requires
- php: ^7.2|^8.0|^8.1
- illuminate/console: ~5.4|~6.0|~7.0|~8.0|~9.0|~10.0
- illuminate/contracts: ~5.4|~6.0|~7.0|~8.0|~9.0|~10.0
- illuminate/http: ~5.4|~6.0|~7.0|~8.0|~9.0|~10.0
- illuminate/support: ~5.4|~6.0|~7.0|~8.0|~9.0|~10.0
- predis/predis: ^1.1
Requires (Dev)
- codedungeon/phpunit-result-printer: ^0.31.0
- laravel/lumen-framework: ~5.4|~6.0|~7.0|~8.0|~9.0|~10.0
- mockery/mockery: ~1.5
- php-coveralls/php-coveralls: ^2.1
- php-mock/php-mock: ^2.3
- phpunit/php-code-coverage: ^10
- phpunit/phpunit: ^10
- swoole/ide-helper: @dev
- dev-master
- v2.13.0
- v2.12.2
- v2.12.1
- v2.12.0
- v2.11.0
- v2.10.0
- v2.9.0
- 2.8.2
- 2.8.1
- v2.8.0
- v2.7.0
- v2.6.69
- v2.6.68
- v2.6.67
- v2.6.66
- v2.6.65
- v2.6.64
- v2.6.63
- v2.6.62
- v2.6.61
- v2.6.6
- v2.6.5.4
- v2.6.5.3
- v2.6.5.2
- v2.6.5.1
- v2.6.5
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.9
- v2.3.8
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.1
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.6
- 2.0.5
- v2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- dev-travis-cache
- dev-hotfix/fix-request-test
- dev-improvement/php8
- dev-develop
- dev-feature/coroutine_feature
This package is auto-updated.
Last update: 2024-10-10 03:47:28 UTC
README
Warning
This package is no longer maintained, we strongly recommend using Laravel's official laravel/octane as an alternative.
If you need coroutine support, consider trying laravel-hyperf for higher performance (This is a Laravel style Hyperf framework.)
Laravel-Swoole
This package provides a high performance HTTP server to speed up your Laravel/Lumen application based on Swoole.
Version Compatibility
Features
- Run Laravel/Lumen application on top of Swoole.
- Outstanding performance boosting up to 5x faster.
- Sandbox mode to isolate app container.
- Support running websocket server in Laravel.
- Support
Socket.io
protocol. - Support Swoole table for cross-process data sharing.
Documentation
Please see Wiki
Benchmark
Test with clean Lumen 5.6, using DigitalOcean 3 CPUs / 1 GB Memory / PHP 7.2 / Ubuntu 16.04.4 x64
Benchmarking Tool: 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
Q&A
The common questions are collected in Q&A. You can go check if your question is listed in the document.
Issues and Support
Please read Issues Guideline before you submit an issue, thanks.
Bugs and feature request are tracked on GitHub.
Credits
Alternatives
License
The Laravel-Swoole package is open-sourced software licensed under the MIT license.
Support on Beerpay
Hey dude! Help me out for a couple of 🍻!