[Grok-dev] a nice research project

Michael Haubenwallner michael at d2m.at
Sun Feb 8 02:31:43 EST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris McDonough wrote:
> Martijn Faassen wrote:
>> Hey,
>>
>> How one would do such research could be:
>>
>> * replicate the setup
>>
>> * place a "import pdb; pdb.set_trace()" in some function (like somewhere 
>> in minidom or ZPT) that we don't understand gets called in this case.
>>
>> * start grok
>>
>> * make a request
>>
>> * in pdb, look at the 'bt' (backtrace), and perhaps use 'up' to walk up 
>> the call chain, trying to understand what is triggering this.
> 
> You can also use repoze.profile
> (http://pypi.python.org/packages/source/r/repoze.profile/repoze.profile-0.6.tar.gz#md5=544a3f626c407eeda5daa3bf5bd77aeb)
> for this.  It's likely a lot easier than what's described above.
> 
> To install it into a grokproject-generated Grok instance add it to the eggs
> section of the [app] section of your buildout:
> 
> [app]
> recipe = zc.recipe.egg
> eggs = helloworld
>        z3c.evalexception>=2.0
>        Paste
>        PasteScript
>        PasteDeploy
>        repoze.profile
> 
> Then rerun buildout.
> 
> Put repoze.profile in the WSGI pipeline e.g.:
> 
> [pipeline:main]
> pipeline =
>    egg:repoze.profile#profile
>    egg:helloworld
> 
> [server:main]
> use = egg:Paste#http
> host = 127.0.0.1
> port = 8080
> 
> [DEFAULT]
> # set the name of the zope.conf file
> zope_conf = %(here)s/zope.conf
> 
> 
> Then restart your Grok app and unleash ab on the app.  When it's done, visit
> http://localhost:8080/__profile__, and in the "mode" dropdown, select "callers",
> then click "Update".  It will show you in the left hand column the function that
> was called; in the right hand column the callers of that function.
> 
> - C

Thanks Chris for providing the wsgi setup. I tried with python2.5.2,
grok-1.0.a2, 'devmode off', "ab -n1000 -c4
http://127.0.0.1:8080/helloworld" and came down to 309 calls vs. your
900+ calls profile. Results are here:

http://gbe.d2m.at/Pastebin/17

My guess is, that you maybe forgot to reset the profiler before running
ab (setting up the application in the admin screens typically gets me
900+ calls in the profiler and shows talinterpreter calls and stuff).

I hope this puts some more light on the scene. Numbers are still high
enough.

Regards
Michael

- --
http://blog.d2m.at
http://planetzope.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJjopfl0uAvQJUKVYRAnTEAKCd/D4FK7IxtdrYGebvm5U9Vx7wlQCdGOFy
Mc/DxQpXHKeM4RpxPlnryJY=
=/csR
-----END PGP SIGNATURE-----



More information about the Grok-dev mailing list