Git Product home page Git Product logo

lumen-swoole's Introduction

lumen-swoole

Build Status StyleCI Scrutinizer Code Quality

Run lumen on swoole to get better performance.

Installation

for lumen 5.2
composer require encore/lumen-swoole dev-master

for lumen 5.3
composer require encore/lumen-swoole 5.3.x-dev

Usage

➜  lumen-v5.2.1 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).

lumen-swoole's People

Contributors

z-song avatar

Watchers

James Cloos avatar XiaoGai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.