[comp.unix.questions] Idle and Looping Process Killers?

mroz@eplrx7.uucp (Peter Mroz) (02/27/91)

I'm looking for a program (exe or shell script) that will kill idle processes
on Unix.  I also need a program that detects runaway processes.  I could 
probably whip up something using AWK but I thought I'd check the net first.

Thanks,

Peter Mroz
-- 
    Peter Mroz                    |    E.I. Du Pont de Nemours & Co.
    eplrx7!mroz@uunet.uu.net      |    Consultant, Scicon
    mrozpa%wmvx@dupont.com        |    DuPont Building, D4078
                                  |    Wilmington, DE 19898
--
The UUCP Mailer

jik@athena.mit.edu (Jonathan I. Kamens) (02/28/91)

In article <1991Feb27.041048.24190@eplrx7.uucp>, mroz@eplrx7.uucp (Peter Mroz) writes:
|> I'm looking for a program (exe or shell script) that will kill idle processes
|> on Unix.  I also need a program that detects runaway processes.  I could 
|> probably whip up something using AWK but I thought I'd check the net first.

  Um, can you define what you mean by "idle processes" and "runaway processes?"

  By "idle processes," do you mean idle login sessions?  If so, there are
plenty of packages in the comp.sources.unix archives ("untamo" comes to mind
as one of them) that are designed to do that and that are quite configurable.

  If that's not what you mean, what do you mean?

  And I can't comment about "runaway processes" without more details.

-- 
Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik@Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8085			      Home: 617-782-0710

barmar@think.com (Barry Margolin) (02/28/91)

In article <1991Feb27.041048.24190@eplrx7.uucp> mroz@eplrx7.uucp (Peter Mroz) writes:
>I'm looking for a program (exe or shell script) that will kill idle processes
>on Unix.  I also need a program that detects runaway processes.

How would you define these precisely enough that a program could recognize
them?  When I manually kill such processes, I use a number of heuristics.
For instance, a GNU emacs or Korn shell process running hard but with very
small resident set size is probably in a loop due to losing its tty.  Last
night I killed a uuxqt process that had been running for four hours, using
about 12% CPU/real time on a Sun-3/280 (it might have been doing useful
stuff, but the system was having performance problems and I doubted it was
important enough).


--
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar

emv@ox.com (Ed Vielmetti) (02/28/91)

(note followups redirected to comp.unix.admin)

In article <1991Feb27.041048.24190@eplrx7.uucp> mroz@eplrx7.uucp (Peter Mroz) writes:

   I'm looking for a program (exe or shell script) that will kill idle processes
   on Unix.  

By "idle processes" do you mean terminals which are sitting idle with
someone logged on but no one around for hours?  Processes which are
sleeping for long periods of time don't absorb that much system
resources.  One program to log out idle users is "untamo", a version
of which can be ftp'd from mthvax.cs.miami.edu:/pub/untamo.shar.Z.

If I remember right the folks at Purdue who wrote this have absolved
themselves of any blame for deficiencies in that version and are
gradually working on a replacement.

   I also need a program that detects runaway processes. 

I find the "top" program quite useful for eyeballing what might be
wrong.  You don't say which version of unix you are running; top has
been ported to a variety of BSD-ish systems, but as far as I can tell
there's no one unified port that works on all of them.  top shows the
processes which are taking up the most cpu time at the moment, with a
display that updates at regular intervals.  Much handier than "ps" for
the task.

Deciding at which point a process is a runaway is not trivial.  Once
you have identified possible candidates, you can snoop on them further
with tools like "pmon" which let you peer into detailed per-process
statistics.

pmon and top for Ultrix are in gatekeeper.dec.com:/pub/DEC/.

-- 
 Msen	Edward Vielmetti
/|---	moderator, comp.archives
	emv@msen.com