Skip to content

Instantly share code, notes, and snippets.

@yihuang
Last active July 17, 2019 10:20
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yihuang/6325913 to your computer and use it in GitHub Desktop.
Save yihuang/6325913 to your computer and use it in GitHub Desktop.
uwsgi gevent benchmark
CPU

Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (X8)

OS

debian7

PYTHON

python2.7.3

GEVENT

gevent-1.0rc1

UWSGI

1.9.15-dev

hello world

def application(environ,start_response):
    s = 'hello world'
    start_response("200 OK", [('Content-Type','text/plain'), ('Content-Length','11')])
    return [s]

if __name__ == '__main__':
    from gevent.wsgi import WSGIServer
    WSGIServer(('localhost', 8000), application).serve_forever()

gevent log

$ wrk -c 100 http://localhost:8000/bench_uwsgi
Running 10s test @ http://localhost:8000/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     8.84s     3.15s   10.00s    88.72%
    Req/Sec     3.15k     3.13k    6.78k    28.19%
  58940 requests in 10.00s, 6.35MB read
  Socket errors: connect 0, read 0, write 0, timeout 296
Requests/sec:   5892.01
Transfer/sec:    650.19KB

gevent nolog

$ wrk -c 100 http://localhost:8000/bench_uwsgi
Running 10s test @ http://localhost:8000/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    15.22ms    3.74ms  59.63ms   97.01%
    Req/Sec     3.38k   404.06     7.38k    97.79%
  66166 requests in 10.00s, 7.13MB read
Requests/sec:   6616.72
Transfer/sec:    730.17KB

nginx-uwsgi-gevent 1 worker 100 core log

uwsgi --socket :9000 --master --processes 1 --gevent 100 -w demo

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    17.15ms  691.25us  22.12ms   89.43%
    Req/Sec     2.95k   111.82     3.18k    84.39%
  57951 requests in 10.00s, 8.73MB read
Requests/sec:   5795.22
Transfer/sec:      0.87MB

nginx-uwsgi-gevent 1 worker 100 core nolog

uwsgi --socket :9000 --master --processes 1 --gevent 100 -w demo --disable-logging

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    13.22ms  310.08us  14.76ms   75.54%
    Req/Sec     3.85k   103.78     4.14k    64.40%
  75408 requests in 10.00s, 11.36MB read
Requests/sec:   7541.03
Transfer/sec:      1.14MB

nginx-uwsgi-gevent 4 worker 100 core nolog

uwsgi --socket :9000 --master --processes 4 --gevent 100 -w demo --disable-logging

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.75ms    1.28ms  17.22ms   75.96%
    Req/Sec    10.74k   465.36    13.50k    81.77%
  208222 requests in 10.00s, 31.37MB read
Requests/sec:  20823.34
Transfer/sec:      3.14MB

nginx-uwsgi-gevent 4 worker 100 core log

uwsgi --socket :9000 --master --processes 4 --gevent 100 -w demo

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     4.56ms    1.59ms  18.64ms   87.76%
    Req/Sec    11.52k     1.62k   18.65k    87.67%
  219352 requests in 10.00s, 33.04MB read
Requests/sec:  21935.67
Transfer/sec:      3.30MB

wsgiref.simple_server.demo_app

gevent log

$ ./wrk -c 100 http://localhost:8000
Running 10s test @ http://localhost:8000
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.77s     1.78s   10.00s    81.79%
    Req/Sec     2.10k     1.02k    2.67k    81.19%
  23920 requests in 10.00s, 14.96MB read
  Socket errors: connect 0, read 0, write 0, timeout 317
Requests/sec:   2391.83
Transfer/sec:      1.50MB

gevent nolog

$ ./wrk -c 100 http://localhost:8000
Running 10s test @ http://localhost:8000
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    44.73ms   38.04ms 129.21ms   43.37%
    Req/Sec     1.49k   638.76     2.25k    54.35%
  26186 requests in 10.00s, 16.38MB read
Requests/sec:   2618.61
Transfer/sec:      1.64MB

uwsgi-gevent 1 worker 100 core log

uwsgi --http :8000 --master --processes 1 --gevent 100 -w demo

$ ./wrk -c 100 http://localhost:8000
Running 10s test @ http://localhost:8000
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    57.55ms    2.39ms  65.77ms   91.30%
    Req/Sec     0.87k    48.09     0.95k    64.38%
  17260 requests in 10.00s, 14.37MB read
  Socket errors: connect 0, read 17258, write 0, timeout 0
Requests/sec:   1725.54
Transfer/sec:      1.44MB

uwsgi-gevent 1 worker 100 core no-log

uwsgi --http :8000 --master --processes 1 --gevent 100 -w demo --disable-logging

$ wrk -c 100 http://localhost:8000/
Running 10s test @ http://localhost:8000/
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    51.70ms  208.00us  53.22ms   75.22%
    Req/Sec     0.97k     4.28     0.98k    80.98%
  19250 requests in 10.00s, 16.02MB read
  Socket errors: connect 0, read 19248, write 0, timeout 0
Requests/sec:   1925.01
Transfer/sec:      1.60MB

uwsgi-gevent 4 worker 100 core log

uwsgi --http :8000 --master --processes 4 --gevent 100 -w demo

$ wrk -c 100 http://localhost:8000/
Running 10s test @ http://localhost:8000/
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    13.92ms  235.61us  16.39ms   92.75%
    Req/Sec     3.63k    82.26     3.87k    78.10%
  70835 requests in 10.00s, 58.90MB read
  Socket errors: connect 0, read 70833, write 0, timeout 0
Requests/sec:   7083.63
Transfer/sec:      5.89MB

uwsgi-gevent 4 worker 100 core log

uwsgi --http :8000 --master --processes 4 --gevent 100 -w demo --disable-logging

$ wrk -c 100 http://localhost:8000/
Running 10s test @ http://localhost:8000/
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    12.73ms  144.08us  13.78ms   93.03%
    Req/Sec     3.96k    78.09     4.12k    72.47%
  77328 requests in 10.00s, 64.29MB read
  Socket errors: connect 0, read 77325, write 0, timeout 0
Requests/sec:   7733.10
Transfer/sec:      6.43MB

nginx-uwsgi-gevent 1 worker 100 core log

uwsgi --socket :9000 --master --processes 1 --gevent 100 -w demo

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    57.97ms  819.61us  66.15ms   98.80%
    Req/Sec     0.87k    22.76     0.91k    61.97%
  17134 requests in 10.00s, 16.47MB read
Requests/sec:   1713.26
Transfer/sec:      1.65MB

nginx-uwsgi-gevent 1 worker 100 core nolog

uwsgi --socket :9000 --master --processes 1 --gevent 100 -w demo --disable-logging

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    55.58ms    3.59ms  62.32ms   76.64%
    Req/Sec     0.91k    54.53     0.95k    77.63%
  17952 requests in 10.00s, 17.26MB read
Requests/sec:   1795.13
Transfer/sec:      1.73MB

nginx-uwsgi-gevent 4 worker 100 core nolog

uwsgi --socket :9000 --master --processes 4 --gevent 100 -w demo --disable-logging

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    13.40ms  151.09us  14.76ms   83.25%
    Req/Sec     3.79k    79.90     4.03k    65.69%
  74202 requests in 10.00s, 71.26MB read
Requests/sec:   7420.24
Transfer/sec:      7.13MB

nginx-uwsgi-gevent 4 worker 100 core log

uwsgi --socket :9000 --master --processes 4 --gevent 100 -w demo

$ wrk -c 100 http://localhost/bench_uwsgi
Running 10s test @ http://localhost/bench_uwsgi
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    14.39ms  250.56us  16.42ms   92.20%
    Req/Sec     3.52k    88.72     3.75k    71.25%
  69002 requests in 10.00s, 66.26MB read
Requests/sec:   6900.11
Transfer/sec:      6.63MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment