4

I checked NGINX Unit documentation for deploying FastAPI and Django Channels. They did not use any ASGI like Uvicorn, Hypercorn, Daphne. Their configuration page also did not mention anything about using these servers.

Updates to NGINX Unit for Autumn 2020 says:

now, you can run ASGI apps, use multithreaded request processing with applications, and include regular expressions in your configuration!

However, FastAPI Documentation and Django Channels Documentation suggest using Uvicorn, Hypercorn, Daphne.

What is the reality here?

Ahmad Ismail
  • 11,636
  • 6
  • 52
  • 87
  • 2
    nginx unit is an ASGI compliant server; you're replacing uvicorn/hypercorn/daphne/etc. with nginx unit instead. It's a choice you make just like you'd make using either of those three or other alternatives. – MatsLindh Oct 20 '21 at 08:05
  • @MatsLindh do you mean I have to install both nginx and nginx unit where nginx unit is the replacement for uvicorn / hypercorn / daphne etc. Or, nginx unit alone can do what nginx + uvicorn / hypercorn / daphne etc. does. – Ahmad Ismail Oct 21 '21 at 05:24
  • You can do either; there are features that nginx support that nginx unit does not; but if you don't need those features, you can deploy nginx unit by itself. See https://unit.nginx.org/howto/integration/ for information about integrating with nginx. – MatsLindh Oct 21 '21 at 07:02
  • in k8s clusters, would using nginx-ingress as the main source for input traffic, while running all my deployments with each pod running fastapi on uvicorn with only 1 worker a good choice for low-latency applications like serving machine learning models? – Naveen Reddy Marthala Jan 14 '22 at 08:04

0 Answers0