Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling on live Django server?

I've never done code coverage in Python, but I'm looking for something like GCC's gcov, which tells me how many times each line executes, or Apple's Shark which gives a hierarchial breakdown of how long each function is taking.

My problem is that I have a live server which is experiencing high load, and I can't tell from the logs what's causing it. I would like to attach something to my Django instance to monitor which lines are the hottest and/or which functions are taking the longest time.

This is something like, but not exactly, code coverage. I would like to introduce it to a live running server, preferably without modifying too much.

Ideas?

like image 806
Joe Avatar asked Nov 21 '11 14:11

Joe


1 Answers

Django-live-profiler is a drop-in Django app that lets you profile your running application using statprof and visualize the results.

like image 94
atereshkin Avatar answered Oct 15 '22 11:10

atereshkin