Choose between gunicorn or uvicorn

I try to use asgi for deploying. At now uvicorn’s have " x-forwarded-for" related bug.
Any way, I do some sample concurrent requests. And don’t find advantage from uvicorn.

My question is : what is the advantage for using sanic with asgi ?

The benefit of uvicorn is to allow for asynchronous processing. With gunicorn and sanic.worker.GunicornWorker, you will have a pretty hard performance penalty.

You could run gunicorn with uvicorn.workers.UvicornWorker, which is a significant increase. But, the most performant solution is with the Sanic server directly. You can see some results from recent benchmarks that I did.

As for ASGI versus Sanic server, it sort of depends upon your use case. Being ASGI, it opens up the ability to use (for example) middleware that runs on ANY ASGI framework. awesome-asgi.

1 Like