×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Hung Results Page

Hung Results Page

Hung Results Page

(OP)
I have a script that is called from the cgi page to be ran on a remote machine, results of which are displayed in the html page it's self.  

On the cgi page I have $| = 1 and am using telnet module with Timeout set to 700, since the remote script can take quite some time to finish.  

CODE

#!/path/to/perl

use CGI;
use CGI::Carp('fatalToBrowser');
use CGI(:/standard/);
$| = 1;

$remoteHost = param('remoteHostIp');
chomp ($remoteHost);
print "$remoteHost;
&postCheck();

sub postCheck() {
$tlOp = new Net::Telnet(Timeout=>700);
....
@targetdata = $tlOp->cmd("runRemoteScript");
if (@targetdata) {
    print "@targetdata";
} else {
    print "What Happened";
  }
}

The problem is that the cgi page just hangs while the remote script has completed execution and most or time takes about 600-650 seconds. This does not happen on all remote machines, only the ones that take quite a while for the remote script to complete.

Any ideas?

RE: Hung Results Page

There's probably a setting on the apache server for how long it takes to time out the loading of each web page.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noevil
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;

RE: Hung Results Page

options maybe to run a cron job at specified intervals and just pick up the datafile on each request.

If there's a webserver on the remote machine, just call an iframe or a frame on that script

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

RE: Hung Results Page

(OP)
travs69:
I looked at the httpd.conf and did not find any time out.  But reasearched and found that Apache has changed the default timeout from 1200 to 300.

PaulTEG:
The scripts on the remote machine are ran only when the users desire to do so, so I can't cron it.  The remote machine is like a dumb terminal, processing data and has no web configured on it.

Is there something I can do after this:

CODE

@targetdata = $tlOp->cmd("runRemoteScript");
to keep the connection alive?  I don't know if sending a ping every 100 secs would do the trick, which I'll try.

RE: Hung Results Page

Instead of running the script on demand, have the user go to a web page that creates a "job", give them a job number, and a page that refreshes till the job is done.  Put that job in a file and have a cron that runs, reads the file, does the job and puts the output somewhere.  You can even have it update the status to the user.  "Job submitted", "Job Running", "Job completed" etc..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
noevil
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;

RE: Hung Results Page

what sort of a job takes 5-6 minutes to run as interactive procedure through a web server? if the job runs every 15 minutes at peak times and every hour off peak, on a cron, they can have the results straight away, though they may be off by a few minutes.

When the architecture of what you've created isn't suited to the environment, then it's either time for trade offs or back to the drawing board.

Are there improvements to the procedures which could speed the process up?
 

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments winky smile

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close