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

I made a quick perl script to CGI-ize a fractal image generator. It works great for small images, but when the pictures take more than about 4 minutes, it appears that the command times out (the image generator is still running, although the perl script has quit). Since this only happens with long wait times, I was wondering if there was someway to tweak the timeout value on shell commands. You can see the full code for the image generator and the perl script here
Thanks in advance!

Replies are listed 'Best First'.
Re: Timeout on shell commands
by cds (Sexton) on Jun 24, 2000 at 16:26 UTC

    I would suspect that the command is not timing out, but the browser connection is. If you send nothing to the browser for a while, it assumes that you're not going to send anything.

    One thing to try would be to have the script kick of image generation to a temporary location. Then go to a new page that reloads every x seconds (where x should be 15-60 (ish)). Check for the image being generated on the new page, and display it (in a new page perhaps) when done.

    Don't forget to clean up older images or you'll fill up your disk. You could do this with a script called by a cron job. Leave enough time for the image to be downloaded.

    Colin Scott
    If you build it, they will be dumb...
Re: Timeout on shell commands
by ScuzzyBug (Initiate) on Jun 24, 2000 at 21:24 UTC
    thanks (i forgot to login earlier), that must be it. I am going to see if i can get around the timeouts by printing "Content-Type: image/png\n\n" really slowly while it is processing.... thanks for the help,
    -Scuzzybug
      You might find merlyn's Search-in-progress Web Techniques column helpful. Basically, get the client to keep querying until the processing is complete.