https://github.com/vshuraeff/pydivider
Simple, threadless, lockless and asynchronous HTTP interface which reply with result of division of A by B
https://github.com/vshuraeff/pydivider
japronto uvloop
Last synced: 10 months ago
JSON representation
Simple, threadless, lockless and asynchronous HTTP interface which reply with result of division of A by B
- Host: GitHub
- URL: https://github.com/vshuraeff/pydivider
- Owner: vshuraeff
- License: mit
- Created: 2018-07-23T23:24:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-24T22:50:52.000Z (over 7 years ago)
- Last Synced: 2025-04-13T14:56:46.171Z (10 months ago)
- Topics: japronto, uvloop
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pydivider
Doing same as [godivider](https://github.com/webislife/godivider)
Uses `japronto` and `uvloop`
- threadless
- lockless
- asynchronous
### install environment and requirements:
`virtualenv --python=python3.6 --download env && source env/bin/activate && pip install -r requirements.txt`
### Run:
`source env/bin/activate && python pydivider.py`
### Output:
```
Accepting connections on http://0.0.0.0:9099
```
__(Press CTRL+C to quit)__
### Test it:
`watch -n .1 'curl -s http://localhost:9099/?a=$RANDOM\&b=$RANDOM'`
### Benchmark
`wrk -t24 -c500 -d30s http://127.0.0.1:9099/?a=$RANDOM\&b=$RANDOM`
```
Running 30s test @ http://127.0.0.1:9099/?a=15296&b=29370
24 threads and 500 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 15.51ms 5.76ms 38.48ms 59.97%
Req/Sec 1.22k 263.99 8.37k 91.09%
875014 requests in 30.08s, 81.78MB read
Socket errors: connect 0, read 533, write 0, timeout 0
Requests/sec: 29088.45
Transfer/sec: 2.72MB
```
### Deactivate env:
`deactivate`