Code profiling and load testing Pressflow on CentOS 5
Profiling setup
- Install xdebug (see Stack installation on CentOS 5)
- Configure with the option:
xdebug.profiler_enable_trigger = 1
- Do not enable any other profiling option.
- Configure with the option:
- Install
cg2dot.py
(via xdebugtoolkit) - Install
graphviz
- Install
ghostscript
Running load tests
- Clear out CacheGrind results from
/tmp
. - Make a single request:
ab -n 1 -c 1 [url]&XDEBUG_PROFILE=1
- CacheGrind output will be on
/tmp
.
Processing results
- Initial setup (do this once):
svn co http://xdebugtoolkit.googlecode.com/svn/tags/0.1.5/xdebugtoolkit/ ~/xdebugtoolkit echo "export PATH=~/xdebugtoolkit:$PATH" >> ~/.bashrc
- Convert the cachegrind output to a
.dot
file:cg2dot.py cachegrind.out.XYZ > cg.dot
- Convert the
.dot
file into PDF-compatible PostScript:dot cg.dot -Tsvg -ocg.svg
- The SVG will be named
cg.svg
.