测试了下,性能不行呀
测试环境
OS: Manjaro Linux 23.1.4
kernel: Linux 6.6.25-1-MANJARO x86_64
CPU: i5-7500
MEM: 64 GB
example.py 是 github 中的例子
zibai v0.10.2
$ python -m zibai example:app --max-workers=1000 --no-access-log
$ wrk -t 8 -c 40 -d 10 http://127.0.0.1:8000
Running 10s test @ http://127.0.0.1:8000
8 threads and 40 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 43.96ms 1.94ms 60.47ms 82.18%
Req/Sec 113.99 12.51 151.00 48.62%
9087 requests in 10.02s, 0.92MB read
Requests/sec: 907.12
Transfer/sec: 94.25KB
$ waitress-serve --port=8000 --threads=1000 example:app
$ wrk -t 8 -c 40 -d 10 http://127.0.0.1:8000
Running 10s test @ http://127.0.0.1:8000
8 threads and 40 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 4.39ms 5.26ms 155.57ms 98.47%
Req/Sec 1.25k 282.07 4.03k 81.15%
99653 requests in 10.10s, 13.97MB read
Requests/sec: 9867.04
Transfer/sec: 1.38MB
$ gunicorn example:app -k gevent --threads=1000
$ wrk -t 8 -c 40 -d 10 http://127.0.0.1:8000
Running 10s test @ http://127.0.0.1:8000
8 threads and 40 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 9.01ms 12.99ms 146.36ms 89.27%
Req/Sec 1.08k 542.24 3.90k 74.09%
86008 requests in 10.01s, 14.03MB read
Requests/sec: 8589.42
Transfer/sec: 1.40MB