Re: Apache timeout on external command
- From: "C." <colin.mckinnon@xxxxxxxxx>
- Date: Fri, 16 May 2008 06:48:30 -0700 (PDT)
On 15 May, 02:11, Ian Petts <ipe...@xxxxxxxxx> wrote:
We have a Solaris 9 server running apache 2.0.53.
I have written a custom Perl cgi script to act as a front-end for a
command-line application on a remote server. The Perl script connects
via ssh to the remote box, runs a command, parses the output and
presents a table to the user with various information about the host.
The host in question is under heavy load and can take anywhere from 20
seconds to about two minutes to complete the command. Every time I run
the command manually from the command line (ssh user@host 'command with
arguments') it eventually returns the expected data, but when running as
part of the cgi script it appears that apache often gives up waiting for
the script to complete and simply stops sending any data back to the
client. The remainder of the Perl script (following the ssh call) does
not get run, but doing a process search on the remote host I can see the
remote command still running to completion after apache has apparently
given up. It seems that if the remote command finishes within 20-30
seconds then the script completes just fine, but if it takes any longer
apache closes the connection to the client browser without letting the
script finish.
I have checked the error log debug entries and can see no difference
between a successful run of the script verses an unsuccessful run, apart
from the length of time reported.
I know the version of apache we are running is quite old, but upgrading
it is not a priority at this time especially since it is an internal
admin server and not publicly accessible.
Can someone please point me at the correct configuration option or other
info to correct this?
Thanks,
Ian.
Have you got a rlimitCPU configured? Are you sure that Apache is
dropping the connection? How long should the browser wait? Are the
requests being made via HTTP/1.1 or 1.0?
Long running jobs are a frequently discussed topic on the web dev
boards - the consensus is that the best solution is to dissociate the
long-running process from the initiating HTTP request. and have it
report-back to datum, then, for example, monitor the datum using ajax.
(hint: a simple way to dissociate a process is `at now myprog`)
C.
.
- Follow-Ups:
- Re: Apache timeout on external command
- From: Ian Petts
- Re: Apache timeout on external command
- References:
- Apache timeout on external command
- From: Ian Petts
- Apache timeout on external command
- Prev by Date: apache webdav ldap auth question
- Next by Date: Re: Apache timeout on external command
- Previous by thread: Apache timeout on external command
- Next by thread: Re: Apache timeout on external command
- Index(es):
Relevant Pages
|