From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076340321654.tru64-unix-managers.marc@archive.invalid> From: Frederic.Arenou () obspm ! fr Date: Fri, 18 Oct 1996 09:59:23 +0000 To: tru64-unix-managers Subject: SUMMARY: reducing process priority X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076340321654 > Is it possible to reduce the priority of a process (apart from using > nice or renice). > I have users who run programs for hours and I would like their prioriti= es > to be automatically reduced, after say 10 minutes of CPU. The overwhelming answer was to use the "autonice" program: ftp://ftp.ba.cnr.it/pub/users/massimo/autonice-0.6 which can be configured on a per user/per process basis. It works great. Another solution is to configure the kernel with the line options AUTONICE in the kernel configuration file.=20 Many thanks to: rioux@ip6480nl.ce.utexas.edu (Tom Rioux) J.Rawcliffe@ee.surrey.ac.uk (Julian Rawcliffe) Peter deFriesse =20 Simon Greaves Geert Jan Bex Oyanarte Portilho iwm@uvo.dec.com Albert De Knuydt Tom Webster "Pedro J. Lobo" =20 Kimble Britten Webb Tim Mooney iwm@uvo.dec.com Other answers: Tim Mooney kindly included a perl script run by cron. >From Albert De Knuydt >Yap, that is possible, and even relatively simple if the users are willi= ng >to cooperate: >Set the 'ulimit' to those 10 minutes (600 seconds). >(ksh) ulimit -t 600 >Now the shell will give a XCPU signal to your program after 600 seconds. >Normally, the user program will terminate at this signal; but if you wri= te >an exception handler that just renices it ... A C source code was kindly given, which must be included in the users pro= grams.=20 >From "Pedro J. Lobo" =20 >As far as I know, it is done automatically on every kind of Un*x. The=20 >system raises the scheduling priority of processes that never wait for=20 >I/O (I mean, raises the number, so the priority is lower). >However, the base priority remains unchanged this way. You may want to=20 >enable the "AUTONICE" option in the kernel configuration file (i.e. add = a=20 >line that reads "options AUTONICE" to that file). This will increase by = 4=20 >the base priority (i.e. it lowers the priority) of threads that eat more= =20 >than 10 minutes of CPU. Exactly what you want :-)=20 This number was not randomly given: I thought this was already the case=20 under Ultrix ;-) >See the manual section=20 >on configuring the kernel (section 5.3.7.6 on the on-line documentation=20 >of DU 3.2c, don't know about other versions). >From Tom Webster >If you don't mind doing it for every user process, it has benn built int= o the=20 >kernel since at least 3.2x. Look in your System Tuning and Performance = > Management >manual for the autonice parameter. If you set this on, it will reduce t= he > prority >of applications that use more than 600 seconds of CPU time. You should = be able >to modify your system's behavior by editing your /etc/sysconfigtab file = and=20 >rebooting. (In theory, you can also use dbx to change some of the tunab= le >kenel parameters on the fly, but I'm generally a little too conservative= to >do much of that on production systems.) >The autonice tuning parameter is NOT well documented, even in the Tuning= book, >you may want to querry DEC's tech support on some of the finer points. = Like >how it tells the difference between an 'application' (like NASTRAN) and = a=20 >server process (like Oracle), if it does. How far the priority is lower= ed, >and if the priority is lowered again every 600 seconds, is not documente= d.=20 >(You should have guessed by now that I haven't actually turned it on for >any of my systems, yet.) >There is also a program on DEC's website for Alpha Freeware that claims = to do >auto-nicing, I haven't looked at it, but it may give you more configurab= ility. >The URL is http://www.digital.com/info/misc/pub-domain-osf1.txt.html. >Another possibility is C2. I noticed in the GUI for 4.0, you can set a = nice > level >for all of a user's jobs, presumably for users who are allowed access to= the > system >but whos work is not considered a priority (or users you are punishing f= or not=20 >nicing their own jobs). =20 --=20 | From: Fr=E9d=E9ric Arenou |-----------------------------------------= ---------| | At: DASGAL- CNRS URA 335 | e-mail: Frederic.Arenou@obspm.fr = | | Observatoire de Paris | URL: http://www.obspm.fr/cgi-bin/whereis?=3D= Arenou | | F-92195 Meudon Cedex | Tel: (33 1) 45 07 78 49 / Fax: 45 07 78 78= |