Server setup that allows long duration CGI process?
I want to set up two webservers that will allow a CGI script (perl based ) to run for hours. Apache gives me timeout errors right now. thanks!
Public Comments
- You can set the timeout limit in the Apache server configuration. This would go within the CGI directive. The current default is 300 (seconds.)
- You can play with timeouts all you like... none will guarantee staying connected for long periods! start with a cgi that forks off a task to do the work, and a second cgi to check to see if it's done. `longRunningProgram.pl &` is the simplest way.
- In httpd.conf, set the TimeOut to a big number. Works for me, I have a webservice that takes several minutes to complete.
- The timeout is to protect the system from runaway applications. For something that long, as a system admin, I would take the CGI outside of the apache-web territory. Have the CGI write the info to a file and just kick back a screen saying "it will be processed", then let that session die. You dont really have anyone waiting that long for the results do you? Then have a server application pick it up from the request file, process it, and write a result page to a web location that the requester can return to in order to see the results. If you do need the original requester to see only their results then have the original CGI create a temporary file name and tell the requester on the "will be processed page". Save that file name to the requester file and have the processing application use it when creating the output.
Powered by Yahoo! Answers