Friday, February 26, 2016

Re: Debugging DJango app on production for High CPU Usage

What sort of load are you experiencing in production? Is it possible that you're simply running into a hardware limitation and need to scale?

On Thursday, February 25, 2016 at 9:29:22 PM UTC-8, Web Architect wrote:
Hi Nikolas,

Cache backend is Redis. The CPU usage is directly proportional to the load (increases with the increase in load). Memory usage seems to be fine.

Thanks.

On Friday, February 26, 2016 at 3:32:23 AM UTC+5:30, Nikolas Stevenson-Molnar wrote:
Which cache backend are you using? Also, how's your memory usage? Do the spikes in CPU correlate with load? I.e., does the CPU use increase/decrease consistently with the number of users?

On Wednesday, February 24, 2016 at 10:17:24 PM UTC-8, Web Architect wrote:
Hi Nikolas,

I am new to uwsgi. Top is showing CPU consumption by uwsgi. Following is my uwsgi configuration:

master=True

socket=:7090

max-requests=5000

processes = 4

threads = 2

enable-threads = true

#harakiri = 30 (not sure if using this would be a good idea)

stats = 127.0.0.1:9191


HW is a dual core processor with CentOS 6 linux. I am not sure if there is a better way to configure uwsgi. uwsgitop is showing only one worker process being heavily used and that is the one spiking to 100% + cpu usage. 

Thanks.


On Thursday, February 25, 2016 at 1:47:43 AM UTC+5:30, Nikolas Stevenson-Molnar wrote:
Just to be clear: is is the uwsgi process(es) consuming the CPU? I ask because you mention DB queries, which wouldn't impact the CPU of uwsgi (you'd see that reflected in the database process).

On Tuesday, February 23, 2016 at 8:59:28 PM UTC-8, 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 django-users+unsubscribe@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/a016c222-a8c8-49a6-a0e8-ae6cbf502619%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment