[Zope] timeout
Richard Barrett
R.Barrett@ftel.co.uk
Fri, 01 Feb 2002 10:41:51 +0000
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 )