--
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 post to this group, send email to django...@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/238a6da2-8f34-4b8b-939c-e20d4306545b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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.
- 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.- 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/- Maybe try using a different database - PostgreSQL, MySQL, etc.
- 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/- 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.
On Thu, May 2, 2019 at 5:09 PM Saurabh Adhikary <adhikar...@gmail.com> 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.
Why don't you upgrade Django at least to 1.11? Django 1.8 extended support ended last year.
On Thu, May 2, 2019 at 2:39 PM Saurabh Adhikary <adhikar...@gmail.com> 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.
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.
- 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.- 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/- Maybe try using a different database - PostgreSQL, MySQL, etc.
- 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/- 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.
On Thu, May 2, 2019 at 5:09 PM Saurabh Adhikary <adhikar...@gmail.com> 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.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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/64e51c12-1ff3-4e9f-a45b-e0d32a6551b3%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMKMUjsHZRHj-j10Bf_5DxapcHu1w2tYBt2vLSFEYpojBHTckA%40mail.gmail.com.
Saurabh what do you use for the WSGI HTTP Server (gunicorn etc.)? Worth checking that as well to make sure it has enough workers.In general performance problems are rarely version related. Usually it's either a bad setup or inefficient code.Django toolbar and most of the other suggestions will help you profile the code but worth seeing how it is served as well.- Nick
On Fri, May 3, 2019 at 10:21 AM Chetan Ganji <ganji...@gmail.com> wrote:
One more thing -All the third party resources i.e. js and css files e.g. bootstrap, jquery, etc; don't fetch them from your server.Use CDN for those. This will help the load times a lot.
On Fri, May 3, 2019 at 2:47 PM Chetan Ganji <ganji...@gmail.com> wrote:
Hi Saurabh,You are welcome :)No 1 will give you insights about which endpoints are taking the most time to load. Then, you can drill down the specific endpoints for bottlenecks.Two more things you could try.1. Remove unused/unnecessary middlewares from the middlewares list in the settings.py of the project.As they are executed before and after every single request, they could add hugh unnecessary overhead easily.2. Normally requests are processed in synchronous manner. Gunicorn has aysnc worker types.I did not have a need to look into it yet, but they could help speed up things.I would not suggest it for payment gateway endpoints. If your project is a ERP/CRM type project, it could help you a little to look into it.Nginx already handles requests async manner. Try combining Nginx + Async worker in gunicorn.You could get some boost.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/64e51c12-1ff3-4e9f-a45b-e0d32a6551b3%40googlegroups.com.
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...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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/e24a0cf4-28ad-482c-b14c-888ed2f242a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@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/08bc1409-322e-41ce-a94b-5dd9db888e86%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/05C52FE4-C1E8-45F1-8146-A9C6D3154AC2%40gmail.com.
--
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 post to this group, send email to django...@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/85afc1b7-f8bb-468d-8759-c41bf3645dce%40googlegroups.com.