Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

CGI Timeout

by spickles (Scribe)
on Aug 12, 2008 at 01:12 UTC ( #703780=perlquestion: print w/replies, xml ) Need Help??
spickles has asked for the wisdom of the Perl Monks concerning the following question:

I am running a CGI script that essentially gathers input from database records and uses those as variables to open a Net::Telnet::Cisco session to a switch and configure access points. At one point, the APs need to reboot, and then continue configuration. The reboot process is at a minimum 1.5 minutes. When I process a smaller amount of APs (1-10) they all come out ok. When I start to process larger numbers of APs, some end up with incomplete configurations. So my question is whether or not there is a timeout value of a CGI script? Would running this as a *.pl file work as well? Can I call a *.pl script from a web page? My thoughts at this point are to split the process into two different scripts while the APs reboot.


Update: Also, if this is run as a *.pl file, can I still provide real time feedback to the user via a web page? Is there a way to see the real time output of the telnet session via a web page?

Replies are listed 'Best First'.
Re: CGI Timeout
by jettero (Monsignor) on Aug 12, 2008 at 01:42 UTC

    This is one of the articles I don't mind linking too off site, because it's awesome: Watching long processes through CGI. Might help.

    UPDATE: I've personally linked to it three times. I've seen merlyn link to it also, which is where I learned of it. I'm not sure it needs more ++s, but I'll take 'em if you're clicking my node.


      Ooh - mod that up! Either here or on

      I've bookmakred it - it's just what I'm in need of too. Thinking about some of the CGI processes I'm working with, and the hoops that I've jumped through to avoid IE/Apache timing out, I've been aware that I really ought to get round to doing it "properly". I think the link above covers all the "research" I'd need for that.

Re: CGI Timeout
by alexm (Chaplain) on Aug 12, 2008 at 15:11 UTC

    Apache has a default timeout of 300 seconds, meaning that your CGI would be aborted after that. Since you didn't mention which HTTP server are you running, YMMV.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://703780]
Approved by jettero
and a log crumbles through the grate...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2017-01-24 14:33 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (205 votes). Check out past polls.