# Django 3.2 ASGI/uvicorn is not production ready!

**URL:** <https://forum.djangoproject.com/t/django-3-2-asgi-uvicorn-is-not-production-ready/8003>\
**Category:** Using Django\
**Created:** [May 21, 2021, 6:50pm UTC](https://forum.djangoproject.com/t/django-3-2-asgi-uvicorn-is-not-production-ready/8003 "2021-05-21T18:50:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![allen-munsch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/allen-munsch/32/1627_2.png) [@allen-munsch](https://forum.djangoproject.com/u/allen-munsch)\
**Post date:** [May 21, 2021, 6:50pm UTC](https://forum.djangoproject.com/t/django-3-2-asgi-uvicorn-is-not-production-ready/8003/1 "2021-05-21T18:50:27Z")

</div>

[https://code.djangoproject.com/ticket/32773](https://code.djangoproject.com/ticket/32773)

anybody able to confirm/deny django 3.2 with ASGI in a production environment?

shouldn’t cost a place an extra 42GB of ram, and however many cores to get the same performance.

> **[allen-munsch/benchmark-django-fastapi](https://github.com/allen-munsch/benchmark-django-fastapi)**
>
> Some rough benchmarks of django with various configurations for WSGI / ASGI, fastapi, uvicorn

doubling the cost of infrastructure to use `get_asgi_application` with `gunicorn asgi:app -k uvicorn.UvicornWOrker`, just isn’t doable.

---

<div class="post-metadata">

**Author:** ![allen-munsch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/allen-munsch/32/1627_2.png) [@allen-munsch](https://forum.djangoproject.com/u/allen-munsch)\
**Post date:** [May 26, 2021, 10:50pm UTC](https://forum.djangoproject.com/t/django-3-2-asgi-uvicorn-is-not-production-ready/8003/2 "2021-05-26T22:50:28Z")

</div>

The main reason for the performance issues was all the blocking IO from the ORM, which previously had all been monkey patched with gevent / eventlet.

Interestingly I’ve decided to approach this from the other direction. Doing/Keeping WSGI and mounting ASGI (preferably should be in the django docs)… instead of doing ASGI and mounting WSGI ( fastapi documenation ).

The fastapi and django docs on the topic range from a bit sparse to a bit misleading.

Anyways … using the werkzeug DispatcherMiddleware has been fine so far.

For example on WSGI with ASGI mounted: [benchmark-django-fastapi/wsgi\_with\_slow\_api\_mounted.py at main · allen-munsch/benchmark-django-fastapi · GitHub](https://github.com/allen-munsch/benchmark-django-fastapi/blob/main/testdjango/wsgi_with_slow_api_mounted.py)

---

<div class="post-metadata">

**Author:** ![allen-munsch](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/allen-munsch/32/1627_2.png) [@allen-munsch](https://forum.djangoproject.com/u/allen-munsch)\
**Post date:** [August 3, 2021, 8:31pm UTC](https://forum.djangoproject.com/t/django-3-2-asgi-uvicorn-is-not-production-ready/8003/3 "2021-08-03T20:31:24Z")

</div>

hmm, not at the moment actually. [How to sync\_to\_async(executor=gevent.threadpool.ThreadPoolExecutor)? · Issue #264 · django/asgiref · GitHub](https://github.com/django/asgiref/issues/264)
