Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

avoid time out

by Anonymous Monk
on May 18, 2004 at 08:05 UTC ( [id://354199]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am calling a script froma webpage. It takes few minutes to complete the processing of the script. In this process the html page shows internal error. Can anyone help me.....i am just a beginer

Replies are listed 'Best First'.
•Re: avoid time out
by merlyn (Sage) on May 18, 2004 at 08:44 UTC
Re: avoid time out
by EdwardG (Vicar) on May 18, 2004 at 08:14 UTC

    Without more information about your environment I can only offer generic help -

    Option 1 - increase the timeout setting on you web server

    Option 2 - speed up your server side script

    My experience has been that it almost always pays to take the second option, since you often have to do that anyway. As a starting idea, you could look at caching results on the server.

     

Re: avoid time out
by coec (Chaplain) on May 18, 2004 at 08:11 UTC
    If all your processing is done in a loop, you can just print a single space character to the webpage. It won't display anything but the browser will be happy as its still receiving data.

    CC

Re: avoid time out
by monkey_boy (Priest) on May 18, 2004 at 08:38 UTC
    I often find that running the main processing in a seperate script in the background, then at the end of this 2nd script, e-mailing the results back to the user, is more effective. Of course this is not always applicable & the above answers are also good options. If the Problem is speed , perhaps you should post your code & we may be able to offer performance suggestions.
    I should really do something about this apathy ... but i just cant be bothered
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: avoid time out
by snadra (Scribe) on May 18, 2004 at 08:32 UTC
    If the script takes a few minutes to proceed, I think it is not the server who is causing your problem, but the user. To please the server, or the clients box, you could flush the content. Use $| for that, and it forces a flush after each print.
    But which user will wait a couple of minutes for a website to load? I wouldn't...

    snadra
Re: avoid time out
by zude (Scribe) on May 18, 2004 at 17:46 UTC
    Hopefully this page isn't publicly accessible? Else I can DOS your server from bash command line:
    while true; do echo -e "GET /yourcgi.cgi HTTP/1.0\n" > /dev/tcp/yourhost.com/80 done

    +++++++++ In theory, theory describes reality, but in reality it doesn't.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://354199]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (7)
As of 2024-04-18 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found