proxy.py/benchmark
Abhinav Singh 99856a6aa7
Change `--local-executor` flag semantics (#907)
* Convert `--local-executor` in an integer flag, defaults to 1 i.e. enabled, use 0 to disable

* Consider any value other than 1 as remote mode

* Use integer to disable local executor mode in integration tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix mypy errors

* Update flags in readme

* Check for type

* Remove pid file check for now

* Update `--local-executor` flag usage

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-27 10:23:38 +05:30
..
README.md Optimizations & Update Benchmark Results (#832) 2021-12-01 04:18:49 +05:30
_aiohttp.py Use `--local-executor` flag by default for Docker container (#880) 2021-12-19 12:48:05 +05:30
_blacksheep.py Use `--local-executor` flag by default for Docker container (#880) 2021-12-19 12:48:05 +05:30
_proxy.py Change `--local-executor` flag semantics (#907) 2021-12-27 10:23:38 +05:30
_starlette.py Use `--local-executor` flag by default for Docker container (#880) 2021-12-19 12:48:05 +05:30
_tornado.py Use `--local-executor` flag by default for Docker container (#880) 2021-12-19 12:48:05 +05:30
compare.sh Use `--local-executor` flag by default for Docker container (#880) 2021-12-19 12:48:05 +05:30
requirements.txt pip prod(deps): bump blacksheep from 1.2.1 to 1.2.2 (#885) 2021-12-21 01:27:15 +05:30

README.md

Benchmark

Table of Contents

TL;DR

NOTE: On Macbook Pro 2019 / 2.4 GHz 8-Core Intel Core i9 / 32 GB RAM

Server Throughput (request/sec) Num Workers Runner
blacksheep 46,564 10 uvicorn
starlette 44,102 10 uvicorn
proxy.py 39,232 10 -
aiohttp 6,615 1 -
tornado 3,301 1 -
  • On a single core, proxy.py yields ~9449 req/sec throughput.
  • Try it using --num-acceptors=1

Usage

 git clone https://github.com/abhinavsingh/proxy.py.git
 cd proxy.py
 pip install -r benchmark/requirements.txt
 ./benchmark/compare.sh > /tmp/compare.log 2>&1

Results

 cat /tmp/compare.log