#32773: Production Configuration of Django 3.2 with gunicorn and uvicorn
-------------------------------------+-------------------------------------
Reporter: allen-munsch | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 3.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => invalid
Old description:
> Hoping for a bit of guidance here.
>
> How can I contribute to the documentation of using django ASGI in a
> production environment?
>
> Also, Any suggestions on tuning these things for relatively the same
> performance?
>
> Current settings ( seems to perform at about the same )
> py3.8.10
> django3.2
> gunicorn with 18 workers using uvicorn.UvicornWorker
> 10 heroku Performance L instances
>
> Previously
> py3.6.13
> django2.2.5
> gunicorn with 10 workers using eventlet
> 7 heroku Performance L instances
>
> However, notice the two instance difference is quite a bit extra in cost.
>
> wrote out a thing to roughly benchmark django and fastapi being part of
> the same ASGI app.
>
> https://github.com/allen-munsch/benchmark-django-fastapi/
>
> Specifically trying to determine upgrading from django 2.2.5 to django
> 3.2 and layering in FastAPI and running it in a production environment.
>
> Anyone here have any advice on doing that?
>
> https://github.com/allen-munsch/benchmark-django-
> fastapi/blob/main/docker/web/docker-asgi-with-static-entrypoint.sh
> https://github.com/allen-munsch/benchmark-django-
> fastapi/blob/main/testdjango/asgi_with_static.py
>
> I was thinking these but with gunicorn --workers 18 .... on 14 heroku
> Performance L instances, and scaling down to 7
>
> https://devcenter.heroku.com/articles/dyno-types
>
> seems like django 3.2 served with uvicorn under peak load is twice as
> slow in a production environment ...
> pretty spiky to 4x slower in comparison to using gunicorn and eventlet
> with the same number of web workers ( 7 heroku Performance L )
New description:
Hoping for a bit of guidance here.
How can I contribute to the documentation of using django ASGI in a
production environment?
Also, Any suggestions on tuning these things for relatively the same
performance?
Current settings ( seems to perform at about the same )
py3.8.10
django3.2
gunicorn with 18 workers using uvicorn.UvicornWorker
9 heroku Performance L instances
Previously
py3.6.13
django2.2.5
gunicorn with 10 workers using eventlet
7 heroku Performance L instances
However, notice the two instance difference is quite a bit extra in cost.
wrote out a thing to roughly benchmark django and fastapi being part of
the same ASGI app.
https://github.com/allen-munsch/benchmark-django-fastapi/
Specifically trying to determine upgrading from django 2.2.5 to django 3.2
and layering in FastAPI and running it in a production environment.
Anyone here have any advice on doing that?
https://github.com/allen-munsch/benchmark-django-
fastapi/blob/main/docker/web/docker-asgi-with-static-entrypoint.sh
https://github.com/allen-munsch/benchmark-django-
fastapi/blob/main/testdjango/asgi_with_static.py
I was thinking these but with gunicorn --workers 18 .... on 14 heroku
Performance L instances, and scaling down to 7
https://devcenter.heroku.com/articles/dyno-types
seems like django 3.2 served with uvicorn under peak load is twice as slow
in a production environment ...
pretty spiky to 4x slower in comparison to using gunicorn and eventlet
with the same number of web workers ( 7 heroku Performance L )
--
Comment:
Ticket description contains a lot of support questions. Please use one of
[https://code.djangoproject.com/wiki/TicketClosingReasons/UseSupportChannels
support channels].
--
Ticket URL: <https://code.djangoproject.com/ticket/32773#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/070.402dae5ffc6adb8a7b78090ce55805c2%40djangoproject.com.