> 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 priorities
> 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.
Many thanks to:
rioux_at_ip6480nl.ce.utexas.edu (Tom Rioux)
J.Rawcliffe_at_ee.surrey.ac.uk (Julian Rawcliffe)
Peter deFriesse <peter_at_oitunix.oit.umass.edu>
Simon Greaves <S.J.Greaves_at_hw.ac.uk>
Geert Jan Bex <gjb_at_luc.ac.be>
Oyanarte Portilho <portilho_at_helium.fis.unb.br>
iwm_at_uvo.dec.com
Albert De Knuydt <Bert.Deknuydt_at_esat.kuleuven.ac.be>
Tom Webster <webster_at_europa.mdc.com>
"Pedro J. Lobo" <pjlobo_at_euitt.upm.es>
Kimble Britten Webb <kimble_at_maths.unsw.EDU.AU>
Tim Mooney <mooney_at_dogbert.cc.ndsu.NoDak.edu>
iwm_at_uvo.dec.com
Other answers:
Tim Mooney <mooney_at_dogbert.cc.ndsu.NoDak.edu> kindly included a perl
script run by cron.
>From Albert De Knuydt <Bert.Deknuydt_at_esat.kuleuven.ac.be>
>Yap, that is possible, and even relatively simple if the users are willing
>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 write
>an exception handler that just renices it ...
A C source code was kindly given, which must be included in the users programs.
>From "Pedro J. Lobo" <pjlobo_at_euitt.upm.es>
>As far as I know, it is done automatically on every kind of Un*x. The
>system raises the scheduling priority of processes that never wait for
>I/O (I mean, raises the number, so the priority is lower).
>However, the base priority remains unchanged this way. You may want to
>enable the "AUTONICE" option in the kernel configuration file (i.e. add a
>line that reads "options AUTONICE" to that file). This will increase by 4
>the base priority (i.e. it lowers the priority) of threads that eat more
>than 10 minutes of CPU. Exactly what you want :-)
This number was not randomly given: I thought this was already the case
under Ultrix ;-)
>See the manual section
>on configuring the kernel (section 5.3.7.6 on the on-line documentation
>of DU 3.2c, don't know about other versions).
>From Tom Webster <webster_at_europa.mdc.com>
>If you don't mind doing it for every user process, it has benn built into the
>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 the >
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
>rebooting. (In theory, you can also use dbx to change some of the tunable
>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
>server process (like Oracle), if it does. How far the priority is lowered,
>and if the priority is lowered again every 600 seconds, is not documented.
>(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 configurability.
>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 for not
>nicing their own jobs).
--
| From: Frédéric Arenou |--------------------------------------------------|
| At: DASGAL- CNRS URA 335 | e-mail: Frederic.Arenou_at_obspm.fr |
| Observatoire de Paris | URL: http://www.obspm.fr/cgi-bin/whereis?=Arenou |
| F-92195 Meudon Cedex | Tel: (33 1) 45 07 78 49 / Fax: 45 07 78 78 |
Received on Fri Oct 18 1996 - 13:56:46 NZDT