RE: [Zope] Zope hangs when database takes too long to respond
Sorry for the typo error. The subject should read "hangs", not "hands" . ________________________________ From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On Behalf Of Sinang, Danny Sent: Wednesday, September 06, 2006 10:56 PM To: zope@zope.org Subject: [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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sinang, Danny wrote:
Sorry for the typo error.
The subject should read "hangs", not "hands" .
________________________________
From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On Behalf Of Sinang, Danny Sent: Wednesday, September 06, 2006 10:56 PM To: zope@zope.org Subject: [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 ?
It is a "known" limitation of Zope, which has a set number of "worker threads" available to service user requests. If a worker thread blocks (e.g., waiting for MySQL), it is not able to do any work for other pending requests. You can tweak the number of threads in your zope.conf file, via the 'zserver-threads' directive (the default value is 4). If you do increase this value, you also need to increase the number of database connections avialble (via 'pool-size') which will increase the RAM required by your appserver.
Or are there some settings I can tweak to adjust some database connection timeout value ?
Not that I know of. Tres. - -- =================================================================== Tres Seaver +1 202-558-7113 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE/zql+gerLs4ltQ4RAioIAJ98L+XTswgN8cRE24qAf7/kGckA+ACg1ZKp nms3D4/jbMw/KjPVTp+AC5k= =hmb+ -----END PGP SIGNATURE-----
----- Original Message ----- From: "Tres Seaver" <tseaver@palladion.com> To: <zope@zope.org> Sent: Wednesday, September 06, 2006 5:16 PM Subject: [Zope] Re: Zope hangs when database takes too long to respond
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Sinang, Danny wrote:
Sorry for the typo error.
The subject should read "hangs", not "hands" .
________________________________
From: zope-bounces@zope.org [mailto:zope-bounces@zope.org] On Behalf Of Sinang, Danny Sent: Wednesday, September 06, 2006 10:56 PM To: zope@zope.org Subject: [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 ?
It is a "known" limitation of Zope, which has a set number of "worker threads" available to service user requests. If a worker thread blocks (e.g., waiting for MySQL), it is not able to do any work for other pending requests.
You can tweak the number of threads in your zope.conf file, via the 'zserver-threads' directive (the default value is 4). If you do increase this value, you also need to increase the number of database connections avialble (via 'pool-size') which will increase the RAM required by your appserver.
Or are there some settings I can tweak to adjust some database connection timeout value ?
Not that I know of.
Another possible solution is to have a look at twisted: http://twistedmatrix.com/projects/core/documentation/howto/faq.html Jonathan
On Sep 6, 2006, at 5:30 PM, Jonathan wrote:
Another possible solution is to have a look at twisted:
http://twistedmatrix.com/projects/core/documentation/howto/faq.html
Unless he wants to rewrite his application, Twisted likely won't help, right? The OP may also want to see why his MySQL queries are taking "so long" by using the MySQL query log and its optimizer. One potential solution to the immediate "cant access the ZMI when I have all threads tied up in long-running code" problem is Zope "zodb connection policies", which is an idea that I proposed several years ago but never got around to implementing fully. Essentially, you'd be able reserve a ZODB connection for "management" requests. - C
----- Original Message ----- From: "Chris McDonough" <chrism@plope.com> To: "Jonathan" <dev101@magma.ca> Cc: <zope@zope.org> Sent: Wednesday, September 06, 2006 5:40 PM Subject: Re: [Zope] Re: Zope hangs when database takes too long to respond
On Sep 6, 2006, at 5:30 PM, Jonathan wrote:
Another possible solution is to have a look at twisted:
http://twistedmatrix.com/projects/core/documentation/howto/faq.html
Unless he wants to rewrite his application, Twisted likely won't help, right?
Twisted is, as i said "Another possible solution" - yes it will require work to integrate, but it is still a potential solution. I don't like to tell people what to do, i just try to provide alternatives. Jonathan
On Sep 6, 2006, at 5:47 PM, Jonathan wrote:
Unless he wants to rewrite his application, Twisted likely won't help, right?
Twisted is, as i said "Another possible solution" - yes it will require work to integrate, but it is still a potential solution. I don't like to tell people what to do, i just try to provide alternatives.
Well, by those standards, I propose he look at Delphi too... ;-) - C
----- Original Message ----- From: "Chris McDonough" <chrism@plope.com> To: "Jonathan" <dev101@magma.ca> Cc: <zope@zope.org> Sent: Wednesday, September 06, 2006 5:50 PM Subject: Re: [Zope] Re: Zope hangs when database takes too long to respond
On Sep 6, 2006, at 5:47 PM, Jonathan wrote:
Unless he wants to rewrite his application, Twisted likely won't help, right?
Twisted is, as i said "Another possible solution" - yes it will require work to integrate, but it is still a potential solution. I don't like to tell people what to do, i just try to provide alternatives.
Well, by those standards, I propose he look at Delphi too... ;-)
Do you mean he should consult the Oracle? ;-) Jonathan P.S. I really was trying to be helpful
On Sep 6, 2006, at 5:54 PM, Jonathan wrote:
Well, by those standards, I propose he look at Delphi too... ;-)
Do you mean he should consult the Oracle? ;-)
Sure, why not, while he's at it? ;-) We can probably even haul in Interbase.
P.S. I really was trying to be helpful
Sure, I just wanted to provide a counterpoint so he didn't go off and waste time researching Twisted with the belief that there was some way he could "use twisted" without essentially abandoning his current codebase; not that he shouldn't use Twisted or whatever, it's just that the problem can likely be solved within Zope without abandoning what he has already. - C
----- Original Message ----- From: "Chris McDonough" <chrism@plope.com> To: "Jonathan" <dev101@magma.ca> Cc: <zope@zope.org> Sent: Wednesday, September 06, 2006 6:01 PM Subject: Re: [Zope] Re: Zope hangs when database takes too long to respond
On Sep 6, 2006, at 5:54 PM, Jonathan wrote:
Well, by those standards, I propose he look at Delphi too... ;-)
Do you mean he should consult the Oracle? ;-)
Sure, why not, while he's at it? ;-) We can probably even haul in Interbase.
Actually, I was going for the "Oracle at Delphi" reference (oracle knows all, sees all, tells all - for a price), but the reference was possibly a bit obtuse...
participants (4)
-
Chris McDonough -
Jonathan -
Sinang, Danny -
Tres Seaver