SGI deprioritization



 	I recently sent out the following message over the net.  Several
 persons who replied requested that I post a summary of the responses.  An
 unedited listing of the reponses follows.  The message was
 > 	I recall that there was a message over the net about something
 > better than "nice" (which hardly works at all).  Can anyone tell
 me
 > how to keep background jobs from slowing foreground jobs to a
 > crawl?  Thanks.
 > -Don Williams
 -------------
 Return-path: <shenkin (- at -) still3.chem.columbia.edu>
 Received: from mailhub.cc.columbia.edu by ULKYVX.LOUISVILLE.EDU (PMDF V4.2-11
  #3949) id <01H8GHNG56QO8WY4OB (- at -) ULKYVX.LOUISVILLE.EDU>; Thu,
  3 Feb 1994 17:58:10 EST
 Received: from still3.chem.columbia.edu by mailhub.cc.columbia.edu with SMTP id
  AA12656 (5.65c+CU/IDA-1.4.4/HLK for WILLIAMS%XRAY2 (- at -)
 ULKYVX.LOUISVILLE.EDU);
  Thu, 3 Feb 1994 17:59:30 -0500
 Received: by still3.chem.columbia.edu (930416.SGI/930416.SGI.AUTO) for
   (- at -) cunixf.cc.columbia.edu:chemistry (- at -) ccl.net id AA22244; Thu,
  3 Feb 94 17:59:28 -0500
 Date: Thu, 03 Feb 1994 17:59:28 -0500
 From: shenkin (- at -) still3.chem.columbia.edu (Peter Shenkin)
 Subject: RE:  CCL:Deprioritizing SGI unix runs
 To: WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU, chemistry (- at -) ccl.net
 Message-id: <9402032259.AA22244 (- at -) still3.chem.columbia.edu>
 Content-transfer-encoding: 7BIT
 > From: <WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU>
 > Date: Thu, 03 Feb 1994 14:21:38 -0500 (EST)
 > Precedence: bulk
 >
 > 	I recall that there was a message over the net about something
 > better than "nice" (which hardly works at all).  Can anyone tell
 me
 > how to keep background jobs from slowing foreground jobs to a
 > crawl?  Thanks.
 "man npri";  example:  (as superuser, unless it's your job):
 	npri -h 150 -p <process-id>
 will give the existing job <process-id> a non-degrading priority of 150.
 High priorities (like high "nice" values) slow the process down.  150
 is
 a good value for background jobs which should never preempt interactive
 work to a significant extent.  In other words, a job with this priority,
 if it's the only user process on the system, will use 99+% of the CPU
 (e.g., at night), but it will use essentially 0% if someone is at the
 console interacting with, say, a molecular graphics program.
 The difference between npri and nice is that npri gives a *non-
 degrading* priority.  "nice" affects the aging of priorities.
 You can also say, "npri -h 150 <jobname> <job_args>" to
 start up a job
 with a non-degrading priority of 150.
 Hope this helps....
 	-P.
 *****************************************************************************
 ********************** "So much for global warming...."
 *********************
 Peter S. Shenkin, Box 768 Havemeyer Hall, Dept. of Chemistry, Columbia Univ.,
 New York, NY  10027;     shenkin (- at -) still3.chem.columbia.edu;     (212)
 854-5143
 --------------
 Return-path: <Kris.Boulez (- at -) rug.ac.be>
 Received: from mserv.rug.ac.be by ULKYVX.LOUISVILLE.EDU (PMDF V4.2-11 #3949) id
  <01H8GZEGIWI88WYNBA (- at -) ULKYVX.LOUISVILLE.EDU>; Fri, 4 Feb 1994
 02:26:18 EST
 Received: from allserv.rug.ac.be by mserv.rug.ac.be with SMTP id AA29773
  (5.65c/IDA-1.4.4 for <WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU>);
 Fri,
  4 Feb 1994 08:27:22 +0100
 Received: by allserv.rug.ac.be (5.0/SMI-SVR4) id AA01137; Fri,
  4 Feb 94 08:24:51 +0100
 Date: Fri, 04 Feb 1994 08:24:50 +0100 (MET)
 From: Kris Boulez <Kris.Boulez (- at -) rug.ac.be>
 Subject: RE: CCL:Deprioritizing SGI unix runs
 In-reply-to: <01H8GA1EJWOY8WXIBT (- at -) ULKYVX.LOUISVILLE.EDU>
 To: WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU
 Message-id: <Pine.3.89.9402040801.A1081-0100000 (- at -) allserv>
 MIME-version: 1.0
 Content-type: TEXT/PLAIN; charset=US-ASCII
 Content-transfer-encoding: 7BIT
 Content-Length: 270
 Hello
 Look for the manual page on 'npri'. Giving the command 'npri -n 39 -p
 pid' gives the proces with proces id pid the lowest priority and it isn't
 hardly noticed any more that it runs.
 Best regards,
 Kris Boulez
 Biomolecular NMR unit
 University of Gent
 Belgium
 -----------------
 Return-path: <vdvk (- at -) netcom.com>
 Received: from mail.netcom.com (netcom2.netcom.com) by ULKYVX.LOUISVILLE.EDU
  (PMDF V4.2-11 #3949) id <01H8GFH1ZDM88WWIP4 (- at -)
 ULKYVX.LOUISVILLE.EDU>; Thu,
  3 Feb 1994 16:55:44 EST
 Received: from localhost by mail.netcom.com (8.6.4/SMI-4.1/Netcom) id NAA21114;
  Thu, 3 Feb 1994 13:57:51 -0800
 Date: Thu, 03 Feb 1994 13:55:56 -0800 (PST)
 From: Didier Vanderveken <vdvk (- at -) netcom.com>
 Subject: RE: CCL:Deprioritizing SGI unix runs
 In-reply-to: <01H8GA1EJWOY8WXIBT (- at -) ULKYVX.LOUISVILLE.EDU>
 To: WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU
 Message-id: <Pine.3.85.9402031355.A20865-0100000-0100000 (- at -) netcom2>
 MIME-version: 1.0
 Content-type: TEXT/PLAIN; charset=US-ASCII
 Content-transfer-encoding: 7BIT
 Take a look at "npri"... It's really better than "nice".
 I'm using a priority around 150 for background jobs.
 Didier
 ---------------
 Return-path: <tennant%hau410.uk.sb.com (- at -) sb.com>
 Received: from hau410.uk.sb.com by ULKYVX.LOUISVILLE.EDU (PMDF V4.2-11 #3949)
  id <01H8H0PUK6S08WZ6PC (- at -) ULKYVX.LOUISVILLE.EDU>; Fri, 4 Feb 1994
 03:03:48 EST
 Received: by hau410.uk.sb.com (920330.SGI/921111.SGI.ANONFTP) for
  WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU id AA03507; Fri, 4 Feb 94
 08:04:54 GMT
 Date: Fri, 04 Feb 1994 08:01:42 +0000 (GMT)
 From: Mike Tennant <tennant%hau410.uk.sb.com (- at -) sb.com>
 Subject: RE: CCL:Deprioritizing SGI unix runs
 In-reply-to: <01H8GA1EJWOY8WXIBT (- at -) ULKYVX.LOUISVILLE.EDU>
 To: WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU
 Message-id: <Pine.3.87.9402040841.A3441-0100000 (- at -) hau410.uk.sb.com>
 MIME-version: 1.0
 Content-type: TEXT/PLAIN; charset=US-ASCII
 Content-transfer-encoding: 7BIT
 On Thu, 3 Feb 1994 WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU wrote:
 > 	I recall that there was a message over the net about something
 > better than "nice" (which hardly works at all).  Can anyone tell
 me
 > how to keep background jobs from slowing foreground jobs to a
 > crawl?  Thanks.
 Hi Don,
 	there's only really a couple of ways to affect a running job.
 Using the npri command you can decrease the amount of CPU time and the
 nice value (which, as you said, isn't very good) a process has. You can
 also do a kill -20 pid to suspend a job (kill -28 pid restarts it).
 Unfortunately, neither of these will free the memory a process is using,
 so if it's using a lot of memory, SGI has no solution!
 		cheers,
 			Mike.
  _____________________________________________________________________________
 |          _____   ____           ||  SmithKline Beecham Pharmaceuticals Ltd  |
 |         /  ___\\\\ _ \          ||  Coldharbour Rd                          |
 |         | |___  \\|_| |         ||  Harlow                                  |
 |         \____ \ |  _ <          ||  Essex
 |
 |          ___| | | |_| |         ||  CM19 5AD                                |
 |         \_____/ |____/          ||  England                                 |
 |                                 ||  Harlow (0279) 622000x3328               |
 |_________________________________||__________________________________________|
 |                                                                             |
 |        Mike Tennant                                                         |
 |        Email: tennant%hau410.uk.sb.com (- at -) phinet.sb.com
 |
 |*****************************************************************************|
 | 	'Do you have 2 fives for a ten?'  M. Jackson to W. Allen.             |
 -------------------------------------------------------------------------------
 -----------------
 Return-path: <windemut (- at -) cumbnd.bioc.columbia.edu>
 Received: from cumbnd.bioc.columbia.edu by ULKYVX.LOUISVILLE.EDU (PMDF V4.2-11
  #3949) id <01H8HI8UKLOW8WYIZF (- at -) ULKYVX.LOUISVILLE.EDU>; Fri,
  4 Feb 1994 11:25:30 EST
 Received: from sirius by cumbnd.bioc.columbia.edu (NX5.67d/NX3.0M) id AA05318;
  Fri, 4 Feb 94 11:26:46 -0500
 Received: by sirius.bioc.columbia.edu (NX5.67d/NX3.0X) id AA00710; Fri,
  4 Feb 94 11:26:46 -0500
 Received: by NeXT.Mailer (1.100)
 Received: by NeXT Mailer (1.100)
 Date: Fri, 04 Feb 1994 11:26:46 -0500
 From: Andreas Windemuth <windemut (- at -) cumbnd.bioc.columbia.edu>
 Subject: RE: CCL:Deprioritizing SGI unix runs
 To: WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU
 Cc: windemut (- at -) cumbnd.bioc.columbia.edu
 Message-id: <9402041626.AA05318 (- at -) cumbnd.bioc.columbia.edu>
 Content-transfer-encoding: 7BIT
 Don,
 There are only three ways to do what you want:
     1) Suspend background jobs completely while you are at the console
 	("kill -STOP" or "kill -17", resume jobs with "kill
 -CONT" or "kill -19")
     2) run jobs that use less memory
     3) get more memory for your machine
 background/foreground interference is almost always due to
 memory contention, not cpu contention. "nice" only works for
 cpu-time. I don't think there is a way to restrict a jobs access
 to virtual memory, other than suspending it.
 Andreas Windemuth
 +--------------------------------------------------------------------
 |Columbia University, Department of Biochemistry and Biophysics
 |630 West 168th St. BB-221 | tel: (212)-305-6884, fax: 6926, NeXTmail
 |New York, NY 10032        | email: windemut (- at -) cumbnd.bioc.columbia.edu
 +--------------------------------------------------------------------
 ----------------
 Return-path: <terry (- at -) wag.caltech.edu>
 Received: from sgi1 (sgi1.wag.caltech.edu) by ULKYVX.LOUISVILLE.EDU (PMDF
  V4.2-11 #3949) id <01H8GCPFBNIO8WY71I (- at -) ULKYVX.LOUISVILLE.EDU>;
 Thu,
  3 Feb 1994 15:36:16 EST
 Received: by sgi1 id AA11455 (931110.SGI/IDA-1.4.4); Thu,
  3 Feb 94 12:37:35 -0800
 Date: Thu, 03 Feb 1994 12:37:35 -0800
 From: "Terry R. Coley" <terry (- at -) wag.caltech.edu>
 Subject: RE:  CCL:Deprioritizing SGI unix runs
 To: WILLIAMS%XRAY2 (- at -) ULKYVX.LOUISVILLE.EDU
 Cc: terry (- at -) wag.caltech.edu, dewill01 (- at -) ULKYVX.LOUISVILLE.EDU
 Message-id: <9402032037.AA11455 (- at -) sgi1>
 Content-type: TEXT/PLAIN; CHARSET=US-ASCII
 Content-transfer-encoding: 7BIT
 Don,
   I suggest you try "Nanny" which can be obtained from
 ftp.wag.caltech.edu:/pub/nanny.  I am biased because I am one
 of the creators of the program, but it works very well in our
 computational chemistry test site at Caltech.  Nanny uses SGI
 non-degrading priorities to guarantee good interactive
 response while letting batch jobs only fill background
 cycles.
   Send me mail if you need assistance trying it out.
 	Regards,
         - Terry
 Terry R. Coley
 terry (- at -) Pgrams.COM
 Parallelograms
 PO Box AA
 Pasadena, CA  91102
 818-577-5515 Voice/Fax