As you said the project is using DRF for an API, it came to my mind some 
blog post I've read about it:

   - 
   
http://ses4j.github.io/2015/11/23/optimizing-slow-django-rest-framework-performance/
   - 
   https://www.dabapps.com/blog/api-performance-profiling-django-rest-framework/
   - 
   https://docs.djangoproject.com/es/1.9/ref/models/querysets/#prefetch-related
   
I'm sure with some little tricks (that shouldn't be tricks after all) 
you'll go over that situation.
As others said, first look the problem, then search the solution.

In that specific case that you are getting thousand of results from 
database, you can go further in:
- SQL
- Caching
- Serialize
- Pagination

Hope it helps.


El miércoles, 3 de febrero de 2016, 16:30:05 (UTC+1), Joshua Pokotilow 
escribió:
>
> At the startup where I work, we've written a lot of our server code in 
> Django. So far, we've adopted a "build it fast" mentality, so we invested 
> very little time in optimizing our code. A small amount of load testing has 
> revealed our codebase / infrastructure as it stands today needs to run 
> faster and support more users.
>
> We recently hired some new engineers who are extremely skeptical that we 
> should optimize our existing code. Their main concerns are:
>
> - We need to move to a service-oriented infrastructure because Django is 
> too monolithic (monolithic = technology lock-in & difficult to troubleshoot)
> - It's too easy to write slow queries using the Django ORM
> - It's hard to hire Django engineers
> - While Instagram and DISQUS use Django to service large numbers of 
> people, they don't use it for any serious backend work
>
> After having worked with Django for the last 3 years, I'm a big believer 
> in it, and I believe it would scale. To defend my position, I've pointed 
> out to my colleagues that it's easy to identify bottlenecks with tools like 
> the Django Debug Toolbar and Yet Another Django Profiler. With my 
> colleagues present, I've isolated and fixed significant speed problems 
> inside of a few hours. I don't believe the Django ORM is inherently bad, 
> although I do think that coders who use it should Know What They're Doing. 
> Finally, I've referenced blog entries that talk about how Instagram and 
> Disqus use Django on the backend for backend-y tasks.
>
> Despite my best efforts, my colleagues are still pushing to have us 
> rewrite large portions of our infrastructure as separate services before we 
> try to fix them. For example, we have one slow REST endpoint that returns a 
> boatload of user data, and so there's talk about using a new microservice 
> for users in lieu of our existing Django models. Even if we are able to fix 
> bottlenecks we encounter in a timely fashion, my colleagues fear that 
> Django won't scale with the business.
>
> I'm writing this post to garner additional evidence that Django will 
> scale. Anything compelling (and preferably not obvious) that would help 
> shed some light on Django's ability to scale would be *greatly* 
> appreciated, as it's very difficult for me to defend my position that 
> Django is a viable long-term solution without solid evidence to back up my 
> claims. It certainly doesn't help that I don't have any experience scaling 
> Django myself!
>
> Thank you.
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b831b050-fb2f-4718-a9c6-610c6152865a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to