Debugging Ruby Performance
Aman Gupta at Frozen Rails 2011, 2011-09-21
Table of Contents
- 1 lsof - list open files
- 2 tcpdump - dump traffic on a network
- 3 strace - trace system calls and signals
- 4 ltrace - trace library calls
- 5 rbtrace - trace ruby method calls
- 6 perftools - by Google
- 7 perftools.rb - perftools for Ruby code
- 8 rack-perftools - Rack middleware for perftools
- 9 GDB - the GNU debugger
- 10 gdb.rb - gdb hooks for MRI/REE (and some for YARV)
- 11 memprof - a heap visualizer for ruby
- 12 graphite - time series analytics
1 lsof - list open files
lsof -nPp <pid>
2 tcpdump - dump traffic on a network
tcpdump -i eth0 -s 0 -nqA <expr>
tcpdump -w <file>
f. Wireshark
3 strace - trace system calls and signals
strace -cp <pid>
- summary mode
-c
count time
- summary mode
strace -ttTP <pid> -o file
- tracing mode
- tracing mode
4 ltrace - trace library calls
ltrace -c
ltrace -ttT -e
5 rbtrace - trace ruby method calls
6 perftools - by Google
pprof ruby ruby.prof --text
7 perftools.rb - perftools for Ruby code
8 rack-perftools - Rack middleware for perftools
9 GDB - the GNU debugger
gdb <executable>
gdb attach <pid>