I have a rather resource intensive CGI that takes quite a long time to start sending data. We've seen quite a few cases where impatient people reload a couple of times, which then triggers additional runs of the CGI to be loaded, or cases where the client times out and drops the connection, but the CGI keeps running.
Is there any good way to detect when this has happened? It doesn't even need to be within the CGI itself (and likely better if it isn't -- it hands off to another program that I don't have control of), but could be a cron job that runs every so often to look for dead connections to reap.
I'm currently using Apache, but this is such a problem that I'd be willing to run some other webserver if it has provisions to deal with it (or a way to let me monitor for the problem).