Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Nov 2004 19:59:12 +0101
From:      "David J. Weller-Fahy" <dave-lists-freebsd-questions@weller-fahy.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Question about nice
Message-ID:  <20041116185850.GA78958@weller-fahy.com>
In-Reply-To: <20041116155632.GD80412@dan.emsphone.com>
References:  <20041116144450.GA70461@weller-fahy.com> <20041116155632.GD80412@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Dan Nelson <dnelson@allantgroup.com> [2004-11-16 16:56 +0100]:
> In the last episode (Nov 16), David J. Weller-Fahy said:
> > If so, what is the difference between the following two commands (in
> > terms of priority level)?
> > nice isoqlog
> > isoqlog
>
> man nice:
>     The nice utility runs utility at an altered scheduling priority,
>     by incrementing its `nice'' value by the specified increment, or a
>     default value of 10.

Doh!  I missed that in the man page.  Ok, I dug a little deeper and
found that the default priority is 0 (man setpriority, who would've
figured? :).  So, to answer my own question (with your prompting):
Prepending 'nice' to any command runs it at priority 10, without 'nice'
it would run at 0 (or 'normal').

Idle priorities range from 0 to 31, realtime from 0 to 31, and normal
priority is in between (and, according to setpriority, is also 0...
lots of zeros).

So it will make a difference.

> > nice sudo isoqlog
> > sudo nice isoqlog
> The first may take longer to execute on a busy machine, since sudo
> itself is running at a lower priority.  The 2nd may be a security
> hazard, depending on whether you allowed "nice isoqlog" or just "nice"
> (with any command) in your sudo config file.

I had decided not to allow 'nice' with any command, it's pleasant to see
that I was correct.  So using the first syntax for non-time-sensitive
programs would keep those from hogging the machines resources, correct?

Well, I think I've got it, now.  Thanks again for a pointer to the
obvious. ;]

Regards,
-- 
dave [ please don't CC me ]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041116185850.GA78958>