Answer the question
In order to leave comments, you need to log in
How to debug Django and reduce CPU usage?
On our server, the load on the CPU suddenly increased from 20-30% to 60-70%. In the top, you can see that 2-3 uwsgi processes are loading the percent, through which Django is launched. But to understand from top which code loads the percentage, of course, it will not work.
What are the means to find the Django code responsible for the load?
Answer the question
In order to leave comments, you need to log in
hmm, nginx logs (for sure it's worth it), enable logging of request processing time, look at which requests are the most, which requests are processed the most.
I recently switched from using uwsgi as a service in debian to supervisor, I ran into a problem that when the supervisor was restarted, the child processes that were processing requests at that moment did not die and each of the non-dead processes loaded the percent into the shelf, adding the die-on-term option to uwsgi config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question