Wednesday, August 3, 2022

Django + uvicorn poor performance

I'm testing Django asgi performance using two very simple views. I'm running gunicorn and uvicorn in such a manner:

 1.  gunicorn core.wsgi --workers=1 --threads=1 --access-logfile=- core.wsgi:application uvicorn --workers 1 core.asgi:application
2. uvicorn --workers 1 core.asgi:application

View is really simple :
def simple_sync_view(request): 
      usernames = "Hello World" 
      return JsonResponse({'message': usernames})

Project has no middlewares enabled. When testing using : wrk -t10 -c100 -d10s http://127.0.0.1:8000/test/sync/ synchronous server is always several times faster.

So I wonder, is the Django in asgi mode so slow or what ?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/44ac71a4-7d6e-481c-a495-e79c8a5d665dn%40googlegroups.com.

No comments:

Post a Comment