Skip to content

Instantly share code, notes, and snippets.

@jebrial
Last active November 28, 2017 22:16
Show Gist options
  • Save jebrial/5b1ebf69fb88c0f57281efa02f3965ba to your computer and use it in GitHub Desktop.
Save jebrial/5b1ebf69fb88c0f57281efa02f3965ba to your computer and use it in GitHub Desktop.
Sanic simple benchmark
"""
Running Sanic local on osx high Sierra:
wrk -t12 -c400 -d30s http://0.0.0.0:5000
Running 30s test @ http://0.0.0.0:5000
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 128.82ms 42.87ms 260.89ms 59.30%
Req/Sec 246.53 93.91 686.00 71.81%
87926 requests in 30.10s, 10.73MB read
Socket errors: connect 0, read 330, write 0, timeout 0
Requests/sec: 2920.93
Transfer/sec: 365.12KB
"""
from sanic import Sanic
from sanic.response import json
app = Sanic()
@app.route("/")
async def test(request):
return json({"hello": "world"})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment