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

2006-09-06 Thread Martijn Pieters

On 9/7/06, Maciej Wisniowski <[EMAIL PROTECTED]> 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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


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

2006-09-06 Thread 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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


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

2006-09-06 Thread Maciej Wisniowski



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
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


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

2006-09-06 Thread Sinang, Danny
> 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

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


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

2006-09-06 Thread Maciej Wisniowski



Whenever the MySQL server experiences heavy load, Zope seems to hang,
such that we can't even access the ZMI.

Is this a bug in version 2.7.6 or ZMySQLDA ?
 


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.


Or are there some settings I can tweak to adjust some database
connection timeout value ?
 


AFAIK not in Zope. Take a look at ZMySQLDA or rather the
python MySQL library it uses. Maybe there is something like that.
You may ask this question on Zope-DB list.

--
Maciej Wisniowski
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


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

2006-09-06 Thread Sinang, Danny



Sorry for the typo error. 
 
The subject should read "hangs", not "hands" 
.


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Sinang, DannySent: 
Wednesday, September 06, 2006 10:56 PMTo: 
zope@zope.orgSubject: [Zope] Zope hands when database takes too long 
to respond

Hello,
 
We wrote an 
application (on Zope v2.7.6-final) that queries a MySQL database via ZMySQLDA 
v2.0.8.
 
Whenever the MySQL 
server experiences heavy load, Zope seems to hang, such that we can't even 
access the ZMI.
 
Is this a bug in 
version 2.7.6 or ZMySQLDA ?
 
Or are there some 
settings I can tweak to adjust some database connection timeout value 
?
 
Regards,
Danny
 
 
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )