[Zope] Zope hangs when database takes too long to respond

Maciej Wisniowski maciej.wisniowski at coig.katowice.pl
Thu Sep 7 02:10:49 EDT 2006


>Besides DeadlockDebugger, is there a way to see just how many threads
>Zope is currently using ?
>  
>
What do you mean by 'currently using'? Zope instance
always uses the number of threads you've
specified in zope.conf.

You may try 'ps -aux|grep zope' if you're on linux box.

If you want to see what threads are doing then I don't
know other tool than DeadlockDebugger for this.

Or... the manual solution...
you may edit a method in ZMySQLDA (possibly query
in db.py) to print some statements before and after it
queries the database. Eg.

import thread
print 'before executing query. thread id: %s' % (thread.get_ident())
r = c.execute() # or something that queries db
print 'after executing query. thread id: %s' % (thread.get_ident())

I don't remember exactly how to display thread id so check this
because the code above may be broken!

You should start your zope in console with runzope
or runzope.bat - you'll she statements from db.py. Of
course you may write these to files with logging
module or something if you don't want to use runzope.

When zope "hangs" you may take a look at your console or
file to see what is the state of threads.

HTH
-- 
Maciej Wisniowski


More information about the Zope mailing list