[Zope] cpu load 99 percent a lot in plone evinironment

Jens Vagelpohl jens at dataflake.org
Fri Feb 9 03:39:27 EST 2007


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


On 9 Feb 2007, at 09:29, Marko Kruijer wrote:
> I do notice that my suspected page is slow, but that's a page  
> template, and there is not very much out of the ordinary going on  
> there. Just a loop in tal over a sql result set.

"Just a loop in tal over a sql result set" can be extremely slow,  
depending on the size of your result set. You may not realize that  
every time you touch one of those resultset record objects the  
security machinery gets in the game to ensure the executing user is  
allowed to see the rendered result. This is true for every single  
field you're trying to show on the page.

Workarounds I have used in this situation (eons ago) involved  
retrieving the resultset in trusted code (inside a filesystem product  
or an External Method) and converting it to a sequence of simple  
types, like a sequence of dictionaries, before handing it back to the  
page template. Those simple types don't cause security assertions and  
the rendering is sped up immensely.

jens


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFzDM/RAx5nvEhZLIRAuXpAJ9hm/EDDx57u/0naxs/U0DZvBsK4ACgrShI
WT5pj0hbBlSf3g1mmXQR5ck=
=8n7A
-----END PGP SIGNATURE-----


More information about the Zope mailing list