Hi, one of my reports takes more than 5 minutes. This causes Zope to produce a timeout. Although it is no good idea to let the user wait that long, I would prefer to show a result anyway. How can I set the timeout? Thanks Ulrich
Ulrich Wisser wrote:
Hi,
one of my reports takes more than 5 minutes. This causes Zope to produce a timeout. Although it is no good idea to let the user wait that long, I would prefer to show a result anyway. How can I set the timeout?
One solution would be to start a thread which does the work. While the thread computes you return a html-page containing a refresh-tag. The page which gets refreshed every X seconds checks if the result is there, if not it returns "please wait". thomas
At 10:14 01/02/2002 +0100, Ulrich Wisser wrote:
Hi,
one of my reports takes more than 5 minutes. This causes Zope to produce a timeout. Although it is no good idea to let the user wait that long, I would prefer to show a result anyway. How can I set the timeout?
The problem is potentially more than just Zope. Lengthy delays may lead to the browser end disconnecting the TCP connection. Then there is the very real problem of user boredom. On a loaded server with lengthy delays, users are prone to hitting the stop and reload buttons on their browser as they imagine something has gone wrong with the first attempt because of the response delay. I do not think that Zope will kill a running thread because the browser it is responding to has dropped the connection over which the request was sent. When the application completes its work and returns to zope's response code, zope can only drop the output in the bit bucket if the connection has been dropped by the browser. The consequence is that the server can become clogged with process generating answers that nobody (now) wants to read. I have certainly seen a case with Apache using a cgi scipt to access a database where an impatient user single-handedly mounted a very effective denial of service attack, with the active cooperation of the cgi script concerned. If it takes a variable, lengthy period to generate a response you might be better changing your approach. One approach is to spawn a detached process and then immediately return a page with a link on it to a status script that can check the spawned process' status. The status script then returns either an informative message plus a link back to itself if the spawned process hasn't completed, or returns the report if it has the spawned script has run to completion and exited. With Javascript you could get even fancier in handling the retrying.
Thanks
Ulrich
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Ulrich Wisser wrote:
one of my reports takes more than 5 minutes. This causes Zope to produce a timeout. Although it is no good idea to let the user wait that long, I would prefer to show a result anyway. How can I set the timeout?
What are you doing that takes that long? I have a 1,500 folders with over 10,000 folders spread throughout. My reports take a long time to generate too. I am switching everything over to using ZCatalogs now. Set up the ZCatalog metadata to store things when it indexes and then just use the catalog when building your reports. Some of my things which took 1 minute to do now take 2 seconds. I'm hoping that this whole report goes from being 10 minutes down to 20 seconds. Still working on it though. :-) -Chris -- -------------------------------------------------------------------- Christopher N. Deckard | Lead Web Systems Developer cnd@ecn.purdue.edu | Engineering Computer Network http://www.ecn.purdue.edu/ | Purdue University ---- zlib.decompress('x\234K\316Kq((-J)M\325KM)\005\000)"\005w') ---
Chris, Lots of things can take that long. I run several queries over millions of rows in Postgresql that can take several minutes. It is preferable to batch these jobs with cron and standalone python. Troy Christopher N. Deckard wrote:
Ulrich Wisser wrote:
one of my reports takes more than 5 minutes. This causes Zope to produce a timeout. Although it is no good idea to let the user wait that long, I would prefer to show a result anyway. How can I set the timeout?
What are you doing that takes that long? I have a 1,500 folders with over 10,000 folders spread throughout. My reports take a long time to generate too. I am switching everything over to using ZCatalogs now. Set up the ZCatalog metadata to store things when it indexes and then just use the catalog when building your reports. Some of my things which took 1 minute to do now take 2 seconds. I'm hoping that this whole report goes from being 10 minutes down to 20 seconds. Still working on it though. :-)
-Chris
participants (5)
-
Christopher N. Deckard -
Richard Barrett -
Thomas Guettler -
Troy Farrell -
Ulrich Wisser