Hi Avraham, Please find my comments inline.
On Wednesday, February 24, 2016 at 6:49:29 PM UTC+5:30, Avraham Serour wrote: > > > sometimes going beyond 100% > > how?? > > That's what I am trying to figure out :) > You can use django-debug-toolbar on your development machine, check the > logs for the pages that take the longest to process and the one that are > the most requested and start with those, of course your CPU won't be high > but you should check and compare if there were improvements after changes. > I have done that on our development machine. There aren't much heavy calculation being done in any of the views. Only thing is MySQL access. But we have template based caching which is obviously reducing the DB queries for the cached period. > > Do you know already if the CPU usage spike is caused by django and not > another software? do you have other stuff in the same server? database? > elasticsearch? mongodb? celery workers? > We are using Solr but with top, won't that show as CPU consumption by java? We do not have celery. Since it's ecommerce platform, its image intensive where we are using sorl thumbnail to generate thumbnails dynamically. But Sorl caches the thumbnails. Hence Image processing could have been CPU intensive but thats also being cached. > were specifically are you using cache? I'm not familiar with the technical > term "all over the place" > Mostly in templates. I think that should help (won't be needed in views I presume). Also, caching the DB results. > > > does the Django ORM increase the CPU usage? > > using the ORM increase the CPU usage if you compare to not using it, the > fastest code is the one that does't run > > Avraham > > > On Wed, Feb 24, 2016 at 9:10 AM, Asif Saifuddin <[email protected] > <javascript:>> wrote: > >> What is your server configuration and system usage statistics? >> >> On Wednesday, February 24, 2016 at 10:59:28 AM UTC+6, Web Architect wrote: >>> >>> Hi, >>> >>> We have an ecommerce platform based on Django. We are using uwsgi to run >>> the app. The issue the CPU usage is hitting the roof (sometimes going >>> beyond 100%) for some scenarios. I would like to debug the platform on >>> Production to see where the CPU consumption is happening. We have used >>> Cache all over the place (including templates) as well - hence, the DB >>> queries would be quite limited. >>> >>> I would refrain from using Django-debug toolbar as it slows down the >>> platform further, increases the CPU usage and also need to turn the DEBUG >>> on. Is there any other tool or way to debug the platform? Would appreciate >>> any recommendations/suggestions. >>> >>> Also, does the Django ORM increase the CPU usage? Does it block the CPU? >>> Would appreciate if anyone could throw some light on this. >>> >>> Thanks. >>> >> -- >> 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 [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <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/69176a56-5604-4b3e-9887-9ebedf55dbb4%40googlegroups.com >> >> <https://groups.google.com/d/msgid/django-users/69176a56-5604-4b3e-9887-9ebedf55dbb4%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 [email protected]. To post to this group, send email to [email protected]. 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/a28fe32c-b0d2-4ff7-8fa8-580d19e4eafe%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

