Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
# Used by pyrasite to inject code into a running process
sudo apt-get install gdb
 
# Used to allow pyrasite to inspect the internals of a running process
sudo apt-get install python-dbg
 
# Make sure that gdb can find debugging symbols for the virtualenv python
sudo mkdir -p /usr/lib/debug/opt/edx
sudo ln -s /usr/lib/debug/{usr,opt/edx}/bin
 
# Enable ptrace
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
 

Meliae

Dumps memory from a process, killing it as well.

To dump memory from and kill a process, run:

Code Block
kill -SIGPROF <process>

Note: this is only enabled for production environments right now. In order to get this to work for local environments, you need to make sure that the memory dumper is installed on startup. So add

Code Block
languagepy
import openedx.core.operations
openedx.core.operations.install_memory_dumper()

to manage.py.

You'll find the memory dump in the /tmp directory.

 

Pyrasite

A python library that uses gdb to inject code into a running python process. Can be used for viewing memory statistics, and also other live process inspection.

...