Hi,
I am building a web app using Sanic and a little confused about how to deploy it in production.
I tried running the app in production using the following code:
app.run(host=‘0.0.0.0’, port=‘8000’, workers=2)
I also tried running my server in async mode using the code mentioned in the following examples:
- https://github.com/huge-success/sanic/blob/5928c5005786b690539d3cf2c2814f696a326104/examples/run_async_advanced.py
- https://github.com/huge-success/sanic/blob/5928c5005786b690539d3cf2c2814f696a326104/examples/run_async.py
There is a performance gain in terms of request/second using the above two examples but looks like there won’t be multiple worker support if I go ahead in this direction.
My application would rely on background tasks as well and I don’t want to keep a single worker running to serve my requests.
Am I reading this correct or I just missed something basic here?