[Zope] Multithreading sessions

Jon Emmons jon.emmons at earthwavetech.com
Fri May 23 12:49:26 EDT 2008

Thanks Kevin,

Another thought I had, is that Zope has only one python interpreter running,
pretty much forcing all processing to be serial by default given what you've
just said.

In the zope.conf there is a setting:
Which defaults to 500 (I assume milliseconds, no documentation to confirm)

It is supposed to check the various threads at that interval.  If the
multi-threading is "sequential" then I may be out of luck.  However, given
what you said, I should see even 1 cpu give each session thread time slices.

Just a thought; I am still trying to find a definitive answer to what is
happening, or a clear path to true multithreaded session handling.

Jon Emmons

-----Original Message-----
From: Sours, Kevin [mailto:KSours at carsdirect.com] 
Sent: Friday, May 23, 2008 11:48 AM
To: Jon Emmons; zope at zope.org
Subject: RE: [Zope] Multithreading sessions

What it sounds like is that Python is using a "sequential" threading
model.  I don't know about Python in particular, but some languages
implement a sequential model internally so that multithreaded programs
will run correctly (if not effeciently) in the absense of whatever
thread libraries the language uses for normal threading.

As an aside, something I learned the hard way is that Python doesn't
thread very well.  The documentation talks a lot about threading, but in
most instances only one thread can run at a given time (it should still
swap between threads, though).  I never saw any benefit to increasing
z-server-threads beyond 4 -- all the extra threads are going to do is
consume memory.  If you need get real concurrency (for example to make
use of additional processors) you need to run multiple zope processes.

-----Original Message-----
From: zope-bounces at zope.org [mailto:zope-bounces at zope.org] On Behalf Of
Jon Emmons
Sent: Friday, May 23, 2008 8:10 AM
To: 'Jaroslav Lukesh'; zope at zope.org
Subject: RE: [Zope] Multithreading sessions

Jaroslav and everyone,

I have made the changes Jaroslav suggested and I cannot get Zope to
serve even 2 sessions simultaneously.

In our testing, one client will start a query to the data servers.
Another will try to simply get the logon page to be served.  Zope will
simply sit there and wait until the DB returns its results for the first
user before doing anything at all for the second.  The 2nd user is not
hitting the DB server.  The python script accessing the data is waiting
for the results for the first user.  Could python be the problem?

I am running python 2.4.4.

Is it possible that I missed a flag or something when I build the Zope?

Thanks for your suggestions so far, but I think I have missed a
fundamental setup step that allows zope to multithread sessions.

If I were echoing what was being served to the clients, shouldn't I see
it interwoven?  I don't, it is always (client 1's results) then (client
2's results)... very atomic.

Thanks again,

Jon Emmons

-----Original Message-----
From: Jaroslav Lukesh [mailto:lukesh at seznam.cz]
Sent: Friday, May 23, 2008 9:37 AM
To: Jon Emmons; zope at zope.org
Subject: Re: [Zope] Multithreading sessions

Hi Jon,

I use 24 zserver-threads and I have here defined number of ZoDB

in your instance etc/zope.conf look for that section:

<zodb_db main>
    # Main FileStorage database
      path $INSTANCE/var/Data.fs
    mount-point /
    cache-size 1000
    pool-size 24

Please pay attention, if you have bunch of cache, your RAM shoul be

Regards, JL.

----- Original Message -----
From: "Jon Emmons" <jon.emmons at earthwavetech.com>

> I had already gone into zope.conf and added the line:
> zserver-threads 10
> This seemed to have no effect.  Is that what you mean?
> You think I should bump it higher?  100 maybe?

Zope maillist  -  Zope at zope.org
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-dev )

More information about the Zope mailing list