RE: [Zope] Zope hangs when database takes too long to respond
Seems that all your Zope threads are busy (they're waiting for database response). There is no more threads to serve next requests so they're waiting (you may say that zope hangs in this situation, but in fact all it's threads are waiting for DB). You may install DeadlockDebugger product and you'll be able to see what your's Zope threads are really doing.
Thanks. Besides DeadlockDebugger, is there a way to see just how many threads Zope is currently using ? Regards, Danny
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
When zope "hangs" you may take a look at your console or file to see what is the state of threads.
Ergh.. I should have written that you'll see whether threads are waiting for database... If any thread does something different it won't be shown here. -- Maciej Wisniowski
On 9/7/06, Maciej Wisniowski <maciej.wisniowski@coig.katowice.pl> wrote:
When zope "hangs" you may take a look at your console or file to see what is the state of threads.
Ergh.. I should have written that you'll see whether threads are waiting for database... If any thread does something different it won't be shown here.
If there are any threads left to serve web requests, you could look at the Control Panel debug information, where you can see the currently processing requests. -- Martijn Pieters
participants (3)
-
Maciej Wisniowski -
Martijn Pieters -
Sinang, Danny