Operating System - HP-UX
1834650 Members
2514 Online
110069 Solutions
New Discussion

Re: csh (cgi scripts) occasionally hang

 
SOLVED
Go to solution
TD Clark
Advisor

csh (cgi scripts) occasionally hang

I've been working on this problem with one of our developers and like to bounce it off of some of you to get some ideas. Last Friday we took a 10 minute outage due to resource (fork) limit reached for the www user on our web server. I found that the www user had 44 csh (cgi scripts) running for as long as 2 weeks (they should only run for seconds). I have the developer looking into this problem now, it appears that the proper exits are in place in the scripts. The only commonality with all of these scripts is they all source in other files. I'm not aware of a problem using source in cgi scripts, does anyone have an idea what could be causing these scripts to hang? It's also important to note that this problem doesn't happen every time the scripts are run - just occasionally. Thanks for any ideas
3 REPLIES 3
Mark Greene_1
Honored Contributor

Re: csh (cgi scripts) occasionally hang

do any of the scripts remove files to which other processes (or other of these similar scripts) may also have access too?

HTH
mark
the future will be a lot like now, only later
Christopher Caldwell
Honored Contributor
Solution

Re: csh (cgi scripts) occasionally hang

I don't deal much with shell scripting cgi (sh, ksh, csh), but I can give you some things to consider:

Most modern web server support the concept of cgi script timeout - set it to something like 300 seconds. This timeout kills scripts that hang for indeterminate reasons.
-look for directives named timeout, cgi timeout, and cgi expiration timeout.

Have your coders add a signal handler in their scripts (probably harder in shell, easier in C and perl) that alarms after n seconds - the handler kills the running process.

Look at things like iPlanet - in their new script model, they unbind the script from the server so that the server isn't penalized for what the script does.

Tune up maxuprc.

Tune up your max server settings in your web server (or threads if that's appropriate).
TD Clark
Advisor

Re: csh (cgi scripts) occasionally hang

Mark, good point. We're looking at that now.