Wednesday, March 24, 2021

Re: Django application is slow


I have checked on the developer tool Waiting (TTFB) is taking 6 seconds. no query is taking long i am sharing a picture of the developer tool response you can have a look.
<Capture.PNG>

That's the devtools from the browser?

That has no visibility to your django queries, etc.  Install Django Debug Toolbar, which can monitor how long each section of the django process is taking so you can identify what is the real bottleneck.

The Web Browser Devtools can't tell a dingo's kidney about how long your queries are taking…

What the Web browser devtool is telling you is that the entire process of getting the web page is taking 6.01 seconds.

So it could be:

  • Header is sent from Django
  • Your Django page has queries embedded, or some other code that starts to run
    • Slowly each element is streamed to the web browser due to the Query processing time
  • The footer of the web page is sent

That entire process can easily explain the slow processing you are seeing, and would match what you are seeing in the WebBrowser Devtool.

Without additional information about your Django setup, we are only guessing.  DDT can give us some additional insight.

- Benjamin




On Wed, Mar 24, 2021 at 11:52 AM Benjamin Schollnick <bschollnick@schollnick.net> wrote:
Dear Programmers, 
my Django application is big and slow any leads on how to make it fast responsive. 

In my experience, if the Django application is slow, it's often related to the database either queries, or the database engine is scaled correctly.
(Of course, that's assuming the computer Django is running on is scaled correctly)

To my knowledge Django Debug Toolbar has *NOT* been updated, and I started to run into compatibility issues with it.  I have had very limited success with SILK, but I don't think I would recommend it….

What are your queries….?

Wait a sec.  DDT HAS been updated?  It claims to support 3.1.1 now?

Install DDT, and take a look at the Time specifically.  See what queries are taking the longest, and try to optimize those specifically.

Also, you do have Indexes on every field that you filter by, right?

- Benjamin




--
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/EA8CE296-A85D-4CD0-A86F-199AED72223C%40schollnick.net.

--
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/CAP%2B6t01Wi7shjrqg_jM%3DEJzNmcLxYL0tTNGXmLYhv4bg9LEqbw%40mail.gmail.com.

No comments:

Post a Comment