encore / lumen-swoole
lumen-swoole can help you work with lumen and swoole.
Installs: 158
Dependents: 0
Suggesters: 0
Security: 0
Stars: 73
Watchers: 5
Forks: 14
Open Issues: 2
Requires
- php: >=7.0
- ext-swoole: >=1.8.0
- laravel/lumen-framework: 5.5.*
Requires (Dev)
- guzzlehttp/guzzle: ^6.2
- laravel/lumen: 5.5.*
- phpunit/phpunit: ~6.0
This package is auto-updated.
Last update: 2024-12-17 17:24:18 UTC
README
Run lumen on swoole to get better performance.
Installation
composer require encore/lumen-swoole
Usage
➜ lumen-v5.5.0 git:(master) vendor/bin/lumen-swoole -h
lumen-swoole 0.1.0
Usage: vendor/bin/lumen-swoole {stop|restart|reload}
-h <hostname> Server hostname (default: 127.0.0.1).
-p <port> Server port (default: 8083).
-s <script> Application script.
-d <daemon> Run server in daemon mode.
-v <version> Output version and exit.
--host Server hostname (default: 127.0.0.1).
--port Server port (default: 8083).
--help Output this help and exit.
--version Output version and exit.
Examples:
vendor/bin/lumen-swoole -d
vendor/bin/lumen-swoole -h 127.0.0.1 -p 80 -d
vendor/bin/lumen-swoole -h 127.0.0.1 -p 80 -d
vendor/bin/lumen-swoole -s path/to/bootstrap/script.php
vendor/bin/lumen-swoole restart
vendor/bin/lumen-swoole reload
vendor/bin/lumen-swoole restart
Other options please see http://wiki.swoole.com/wiki/page/274.html.
After start server, open http://127.0.0.1:8083 in browser.
Benchmark
➜ lumen-v5.2.1 git:(master) ab -c 200 -n 200000 -k http://127.0.0.1:8083/
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 20000 requests
Completed 40000 requests
Completed 60000 requests
Completed 80000 requests
Completed 100000 requests
Completed 120000 requests
Completed 140000 requests
Completed 160000 requests
Completed 180000 requests
Completed 200000 requests
Finished 200000 requests
Server Software: swoole-http-server
Server Hostname: 127.0.0.1
Server Port: 8083
Document Path: /
Document Length: 40 bytes
Concurrency Level: 200
Time taken for tests: 33.035 seconds
Complete requests: 200000
Failed requests: 0
Keep-Alive requests: 200000
Total transferred: 43600000 bytes
HTML transferred: 8000000 bytes
Requests per second: 6054.18 [#/sec] (mean)
Time per request: 33.035 [ms] (mean)
Time per request: 0.165 [ms] (mean, across all concurrent requests)
Transfer rate: 1288.88 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 9
Processing: 17 33 6.2 31 81
Waiting: 17 33 6.2 31 81
Total: 17 33 6.2 31 81
Percentage of the requests served within a certain time (ms)
50% 31
66% 33
75% 35
80% 36
90% 41
95% 46
98% 52
99% 56
100% 81 (longest request)
License
lumen-swoole
is licensed under The MIT License (MIT).