[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] how to prevent time-out with slow outputstream



At 5:59 PM +0100 12/12/00, Christoph Grunau wrote:

>I have  a MacPerl CGI (running under MacOS 9, QPQ2.1) that sanns a 
>number of files for patterns and generates a dynamic web-page with 
>the result. As long as the number of files to scan is relatively 
>small everything works fine.  However, when I screen about 2500 
>files the CGI takes about 1 min to generate the output. I set the 
>server time-out to 300 sec which should be enough but usually the 
>clients time-out much earlier. Is there a way to prevent this?

As far as I have been able to figure (and I have had some experience 
with this issue) the only solution is to return the output a bit at a 
time, a technique sometimes called "server push".  Unfortunately, the 
only way to activate server push for a MacPerl CGI is to name it with 
the .acgi suffix.  I say unfortunately in that this ALSO signals to 
QPQ that your CGI can handle a second request while the first is 
still processing, which is very much not true and results in anything 
from a dropped request to a crashed server.  For a public server I 
would recommend never doing this.  The only time you can safely name 
your CGI scripts with the .acgi suffix is if you can guarantee that 
there will never, ever be overlapping hits or if you can tolerate 
crashes.

If you are still interested, let us know and I will post a "step by step".

>when I try to manually quit the poor CGI that has no more client to 
>deliver the page to does not quit. Alt-Apple-Esc helps to kill it. 
>Any ideas?

Sorry, no.  Remember that the CGI is a separate program from MacPerl 
and the CGI script it is running.  With that in mind, the only idea I 
have is to have the MacPerl script periodically check the elapsed 
time and to give up if too much time has passed.

-David Steffen-
David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org