Django

447 readers
2 users here now

Django Project

Django Community

Django Ecosystem

Jobs
Learning/Docs
Podcasts:
Related Fediverse communities
Feeds

founded 2 years ago
MODERATORS
126
127
 
 

Summary

  • The number of workers for Gunicorn, Uvicorn and Hypercorn should be CPU * 2 + 1
  • The number of threads for WSGI apps should be WORKERS * 2 as a minimum unless you don’t have a lot of memory. If you have more memory you can increase this number
  • The number of threads for ASGI apps is irrelevant because it uses coroutines to dispatch requests
  • ASGI can be faster and scale better than WSGI but only if you’ve written your application as async from the framework to the backend
  • Test your setup using Locust or a similar tool to verify these assumptions
  • Don’t forget about modelling static content in your load tests
128
 
 

I gave this talk at PyCascades 2021 and decided to turn it into a series of blog posts so it's available to folks who didn't attend the conference or don't like to watch videos. Here are the slides and the video if you want to see them.

Part 2: Customizing built-in methods https://www.laceyhenschel.com/blog/2021/2/23/what-you-should-know-about-drf-part-2-customizing-built-in-methods
Part 3: Adding custom endpoints https://www.laceyhenschel.com/blog/2021/2/23/what-you-should-know-about-django-rest-framework-part-3-adding-custom-endpoints

via https://botsin.space/@pyladies_bot/111651150685335427

129
130
2
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 
 

Async Python can be useful in the right situation, but one of the tricky things about it is that it requires a bit more effort to run than normal synchronous Python, because you need an async event loop that can run and manage all your async functions.

131
132
133
134
 
 

If you're out of the loop, CCBV is a tool to help you get your head around Django's class based views.

via https://mas.to/@meshy/111601784814241558

135
136
137
138
139
140
141
13
Django 5.0 released (www.djangoproject.com)
submitted 1 year ago by [email protected] to c/[email protected]
142
143
 
 

lsof -i :8000 -t | xargs -t kill

Commands and options explained in the link

via https://fosstodon.org/@adamchainz/111439517350462222

144
145
5
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
146
147
148
149
150
view more: ‹ prev next ›