← Back to team overview

launchpad-dev team mailing list archive

Re: Getting KCacheGrind profiles of pages on launchpad.dev

 

On 07/20/2010 11:23 AM, John Arbash Meinel wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maris Fogels wrote:
Hi everyone,

During the Epic Robert and I coded up and landed a patch that generates
KCacheGrind profiles for launchpad requests.  KCacheGrind is a powerful
tool for exploring call graphs, and this change should make it easier to
see what pieces of Python are taking the most time to run.

To switch on profiling, add this to
configs/development/launchpad-lazr.conf:


     [profiling]
     profile_requests: True


Then start the dev app server with 'make run', and use curl or wget to
make *one* request to the URL you want:

     $ make run

     $ curl -k https://launchpad.dev/

     $ kcachegrind
2010-07-20_10\:01\:46.680-RootObject\:index.html-OOPS-1662X1-Dummy-2.prof


This is a neat start. Obviously ++profile++ even on some sort of staging
would be more useful just because of the size of data. Anyway, how does
it know what directory to dump the profile to? Just wherever 'make run'
was issued?

John
=:->


There is a "profile_dir" configuration key that defaults to '.' on development systems. So by default it will just dump the *prof files in the directory that 'make run' was called from.

For ++profile++ the goal is to add a new key to allow_profiling (already done), get Zope to ignore the ++profile++ part of the URL (not done), then turn on on-demand profiling on staging (LOSAs).


Maris



References