Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

timeout on a valid long process

by schulerlab (Initiate)
on Sep 07, 2006 at 18:28 UTC ( #571766=perlquestion: print w/replies, xml ) Need Help??

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

Is there any way to build a Pause or something into a routine to keep a rebuild of a large database from timing out? Something that tells the system that the process is not in an endless loop, but is just in a long processing routine?

Replies are listed 'Best First'.
Re: timeout on a valid long process
by b10m (Vicar) on Sep 07, 2006 at 19:14 UTC

    Who's timing it out? A webserver? If so, just read up on auto flushing ($|) and print some null bytes (\0) to the browser every now and then, to keep the connection alive.

    Update: ... and you can read a column by merlyn on watching long processes through CGI.

    --
    b10m

    All code is usually tested, but rarely trusted.
      Thanks. I will check into this.
Re: timeout on a valid long process
by GrandFather (Saint) on Sep 07, 2006 at 18:32 UTC

    What system needs to be told?


    DWIM is Perl's answer to Gödel
      you mean what type of server? this program runs on different types of servers. Mostly Apache servers. The process is rebuilding a database. Not a problem for a database that isn't huge. but the process timesout for databases of around 50k messages. Even though there is really nothing wrong with the program.

        Look at the Timeout keyword in the Apache config file. You can also dump \0 characters to the client periodically to ensure that it does not time out (vs the server timing out).

        --MidLifeXis

      oh my.. my reputation is 0! what would my mother say?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2023-01-31 07:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?