2021-11-29 14:50:23 +00:00
|
|
|
|
# Benchmark
|
|
|
|
|
|
|
|
|
|
# Table of Contents
|
2021-11-29 18:40:04 +00:00
|
|
|
|
- [TL;DR](#tldr)
|
2021-11-29 14:50:23 +00:00
|
|
|
|
- [Usage](#usage)
|
|
|
|
|
- [Results](#results)
|
|
|
|
|
|
2021-11-29 18:40:04 +00:00
|
|
|
|
## TL;DR
|
|
|
|
|
|
2021-11-30 22:48:49 +00:00
|
|
|
|
NOTE: On Macbook Pro 2019 / 2.4 GHz 8-Core Intel Core i9 / 32 GB RAM
|
2021-11-29 18:40:04 +00:00
|
|
|
|
|
2021-11-30 22:48:49 +00:00
|
|
|
|
| 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 | - |
|
2021-11-29 18:40:04 +00:00
|
|
|
|
|
2021-11-30 22:48:49 +00:00
|
|
|
|
- On a single core, `proxy.py` yields `~9449 req/sec` throughput.
|
|
|
|
|
- Try it using `--num-acceptors=1`
|
2021-11-29 18:40:04 +00:00
|
|
|
|
|
2021-11-29 14:50:23 +00:00
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
❯ 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
|
|
|
|
|
|
|
|
|
|
```console
|
|
|
|
|
❯ cat /tmp/compare.log
|
|
|
|
|
```
|