*BSD News Article 44384


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!agate!howland.reston.ans.net!nctuccca.edu.tw!news.cc.nctu.edu.tw!news.sinica!taob
From: taob@gate.sinica.edu.tw (Brian Tao)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Zombie processes eating up CPU time (was Re: Internet Service Provider)
Date: 24 May 1995 04:00:14 GMT
Organization: Institute of Biomedical Sciences, Academia Sinica
Lines: 39
Message-ID: <3pub0e$ppd@gate.sinica.edu.tw>
References: <3pqb92$lq2@pt9201.ped.pto.ford.com> <3prh5v$au8@fnord.dfw.net> <D91uu8.7J3@twwells.com>
NNTP-Posting-Host: @140.109.40.249

In article <D91uu8.7J3@twwells.com>, T. William Wells <bill@twwells.com> wrote:
>
>The biggest problem with FreeBSD (2.0) that I've seen so far is
>that when connections are just "dropped" many programs go into an
>infinite read loop. I need to figure out where that's coming from
>and *fix* it, as it eats CPU time.
>
>BTW, at one time, BSDI had the same problem. Might still.

    I don't think this is as much an OS-related problem as a program
application problem.  For example, on my ISP (which runs BSD/OS 2.0),
the most commonly seen "hung" processes are Lynx 2.3, Pine and tin.
All three poll the tty for keyboard input from the user.  When the
user disappears of his end of the connection, the program goes into a
frenzy looking for input data.  The incessant looping drives the
program to hog almost all the CPU, to the detriment of other
interactive programs.  At least this problem is solved in recent
versions of Lynx.

    Our solution:  give every user a CPU quota.  See the man page on
csh/tcsh for the built-in "limit" command, and the man pages for
getrlimit(2) and setrlimit(2).  Each user is allowed 10 minutes of CPU
time per process.  Any single process exceeding this amount is killed
off.  Initial user reaction will go something like, "What?!?  I'm only
allowed to {upload/download/read mail/read news/IRC/MUD/FTP/etc.} for
ten minutes at a time???  I'm outta here!".  :)  Of course, before
they do leave, you should explain to them the different between CPU
time and real time.  :)  Things you can do with 10 minutes of CPU time
(rough estimates, of course):

  1.  Download a few dozen megabytes of files
  2.  Stay on IRC for few days without logging off
  3.  Read news for an entire working day
  4.  Browse the Web with Lynx until the cows come home

  etc., etc.
-- 
Brian ("Though this be madness, yet there is method in't") Tao
taob@gate.sinica.edu.tw <-- work ........ play --> taob@io.org