I don't think there is a silver bullet that will fix all issues, nor
any one technology stack that will. I have a fairly good size django
app I built, and I did not consider performance all that much during
initial development. As the user base and dataset started to grow I
did see performance issues and I dealt with each one as they arose by
profiling the issue and seeing where the bottlenecks were. Often it
was not at all where I thought it would be. Each case had a different
solution, e.g.: database tuning, adding memory, writing custom queries
using temp tables, minimizing js code, optimizing jQuery code and DOM
manipulation, and so on.

On Wed, Feb 3, 2016 at 11:02 AM, Joshua Pokotilow <jpokoti...@gmail.com> wrote:
> The service uses the Django REST Framework and takes multiple seconds to
> return a response. The response is a JSON array with thousands of
> dictionaries. We haven't yet investigated why it's slow, nor have we tried
> to cache / memoize anything to speed it up.
>
> On Wednesday, February 3, 2016 at 10:46:25 AM UTC-5, Avraham Serour wrote:
>>
>> what do you mean by slow? can you measure in ms?
>>
>> On Wed, Feb 3, 2016 at 5:30 PM, Joshua Pokotilow <jpoko...@gmail.com>
>> wrote:
>>>
>>> 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/CACwCsY7p%2BfHjzUqoRhJn1Cy_djKpgGJRtL1TD210Gx6V9g%3DTMg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to