[Zope] Options for handling concurrency?

Tony McDonald tony.mcdonald@ncl.ac.uk
Thu, 2 Mar 2000 12:19:15 +0000


At 11:29 am -0500 29/2/00, Martijn Pieters wrote:
>  > So, I'm *not* calling ZSQL methods from an External method, I'm using
>>  direct connections to the database using Python libraries. Obviously,
>>  I lose a lot of Zope goodies here, but I really need that speedup...
>
>So, if I understand you correctly, your EM's call query on the DA object
>itself, not using the ZSQL Methods. Then you have no cache whatsoever on
>those queries. Is there no way you can use a ZSQL Method here anyway?
>Just a self.nameOfZSQLMethod(arguments) might speed things up here.

Apologies for the late reply - flu :(

Yes. I create a DBH in an EM and fire away. All I get from the Zope 
system is a request of the form http://supercascade?root_id=240551 
and I start to do my queries. They are nested in the EM to 9 levels 
deep (but normally the first 4 levels are enough to get all the nodes 
of the tree with the relevant root_id). Getting the list of nodes is 
quite fast, about 0.8 seconds. Then I have to render them. I've got 
that down by a factor of ten (since this thread has started in actual 
fact!)

I've also found out just how fast a cached ZSQL method can be - one 
DMTL method that used query took 3.2 seconds on the first render, and 
0.06 seconds on subsequent renders. Obviously some more work needs to 
be done in this area and I'm looking into that.

I'm also told that our MySQL server itself does some caching ... 
looking into that.

>Also, I don't know how your recursive query will work within the one
>thread of a HTTP request.

Ah, I hadn't thought of that...my query isn't recursive however.

>What python libraries do you use?

MySQL (MySQLmodule-1.4), DocumentTemplate and from 
Acquisition,Implicit in the main.

thanks for the thoughts Martijn,
Tone.
------
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2