Django Debug Toolbar is a useful tool, it'll tell you what takes the 
biggest amount of time while the website loads. 

One caveat regarding performance: I once developed a project (running 
Django 1.8 and Python 3.4), and the Toolbar slowed down our back end 
tremendously. We tried to figure out the reason why some pages took as much 
as 20 seconds to load, and discovered by chance that if you disabled the 
toolbar, performance improved considerably (down to 3-4 seconds, or so). 
Obviously, you don't use it in production, so it's only an issue in 
development, but it may be worth knowing if you decide to use DDT. 

Granted, I'm not sure if this happens always, because it was the only 
project where I used DDT.

On Thursday, 2 May 2019 14:22:11 UTC+2, Chetan Ganji wrote:
>
> Not sure about whats the issue. You could do couple of things to 
> understand whats the root cause of the problem.
> I know they are generic guidelines. Anyone couldnt be more specific than 
> this.
>
>
>    1. Benchmark the time required to process each request. You could 
>    write a middleware to track this time. 
>    Attach starttime to each request object and read that at the time of 
>    returning the response. 
>    
>    2. Try using the django debug toolbar to see how much time it is 
>    taking to execute the sql queries. 
>    There might be some room for improvement as most developers dont 
>    practice sql regularly. 
>    https://django-debug-toolbar.readthedocs.io/en/latest/
>    
>    3. Maybe try using a different database - PostgreSQL, MySQL, etc.
>    
>    4. But if you have time for R&D, you could try using the different 
>    python implementation, it is said to be faster in many cases than cpython. 
>    It's not 100% compliant i.e. some packages might not work with pypy. 
>    So please do your research before walking down this road.
>    https://pypy.org/
>    
>    5. Try using a different web server. If you are using Apache, try 
>    using nginx. Also use a different wsgi server. If you are using gunicorn, 
>    try with waitress or others. 
>    
>
>
> Regards,
> Chetan Ganji
> +91-900-483-4183
> ganji...@gmail.com <javascript:>
> http://ryucoder.in
>
>
> On Thu, May 2, 2019 at 5:09 PM Saurabh Adhikary <adhikar...@gmail.com 
> <javascript:>> wrote:
>
>> Hello , 
>>
>> I'm using Django version 1.8.1  and Python version 2.7.12 . Suddenly 
>> since Feb '19 there has been a drastic decrease in my website's response 
>> rate.
>> For sure , there has been some minor increase in the no of hits, but the 
>> performance is too bad.
>>
>> Initially , the thought came that the hardware of the server was old , so 
>> a new server with high configuration was bought.
>> We have done the new indexing also on it.
>> Still the sought for a higher performance is awaited.
>>
>>
>> Is it that the Django support for 1.8.1 or Python support for 2.7.12 has 
>> reduced and that is casing the website to slow down or I am missing out on 
>> something ?
>> Kindly help. 
>>
>> -- 
>> 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...@googlegroups.com <javascript:>.
>> To post to this group, send email to django...@googlegroups.com 
>> <javascript:>.
>> 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/238a6da2-8f34-4b8b-939c-e20d4306545b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/238a6da2-8f34-4b8b-939c-e20d4306545b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/9aa4a7dc-4e6c-4de4-a20c-c9eb4b6e7ef3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to