Django application is slow

74 views
Skip to first unread message

Israr Hussain Rao

unread,
Mar 24, 2021, 4:02:27 AM3/24/21
to django...@googlegroups.com
Dear Programmers, 
my Django application is big and slow any leads on how to make it fast responsive. 



Omkar Parab

unread,
Mar 24, 2021, 4:17:44 AM3/24/21
to django...@googlegroups.com
Check, if your server is capable of handling huge requests or not.
Remove unused JavaScript. Check your querysets. 


--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAP%2B6t01mtTdMf5hRT%3DHbrPDK4H7j5%2B0v3bWbYmUjHicNkyu-zQ%40mail.gmail.com.

Israr Hussain Rao

unread,
Mar 24, 2021, 4:23:21 AM3/24/21
to django...@googlegroups.com
  I have rechecked my code and did my best to shorten the code and removed unused javascript as well. 
I will recheck my server capability as well. do you know about the Django cache technique? how can i use it? 




Omkar Parab

unread,
Mar 24, 2021, 4:39:26 AM3/24/21
to django...@googlegroups.com

Israr Hussain Rao

unread,
Mar 24, 2021, 4:43:16 AM3/24/21
to django...@googlegroups.com
I am trying this but i am coınfused either i have to make a separate function or i have to just install Memcache and add the cahe binding to the settings




Omkar Parab

unread,
Mar 24, 2021, 4:55:19 AM3/24/21
to django...@googlegroups.com
I haven't tried this yet. so can't tell you much about it. 

Benjamin Schollnick

unread,
Mar 24, 2021, 5:53:27 AM3/24/21
to django...@googlegroups.com
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



Israr Hussain Rao

unread,
Mar 24, 2021, 7:46:07 AM3/24/21
to django...@googlegroups.com

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



--
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...@googlegroups.com.

Benjamin Schollnick

unread,
Mar 24, 2021, 8:07:51 AM3/24/21
to django...@googlegroups.com
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 <bscho...@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...@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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages