[Zope] ZSQL and python script performance

Sion Morris s.morris at bangor.ac.uk
Mon Jan 10 12:13:02 EST 2005


Hi,

In an attempt to speed up an application I came across a bottle neck with
Python Scripts in Zope.

Using apache's 'ab' utility I tested a simple query (sql_course_components)
directly with the following URL:

ab -n 20 -c 4  
'http://myserver/portal_skins/acs/sql_course_components/manage_test?gcom_id=
19030&term_code=200405&SUBMIT=Submit+Query'

-----    Requests per second:    23.22 [#/sec] (mean)


Using a Python Script (ptest) to return the result from the query is much
slower:

return context.sql_course_components(gcom_id=19030, term_code=200405)

ab -n 20 -c 4 'http://myserver/portal_skins/acs/ptest'

-----    Requests per second:    2.59 [#/sec] (mean)


I tried the same test with an external method with similar results.

Why is there such a big difference between accessing the ZSQL query directly
and using a python script (which is needed to process the query in the real
application) to return the query?

TIA,

Sion







More information about the Zope mailing list