Subject: Re: To renice, or not to renice...
To: Andy R <quadreverb@yahoo.com>
From: David Howland <metalliqaz@hotmail.com>
List: netbsd-help
Date: 03/07/2004 08:46:03
> Wow, we have a famous dude among us!

thats cool, I'm glad he took the time to help me out.  I'm looking into MRTG
daemon mode after I finish this email.

>
> I read both your books, great books. I still pour over
> stuff I've already read to make sure it stays in
> there... Please write more books on BSD! I will buy
> them!
>
> I don't know much about MRTG, but I did install it and
> it looks cool. One of these days I'll actually make it
> work.

I'm no guru, and even tho I now consider myself a capable BSD user, when I
got MRTG working, I was a total noob.  It was easy (for me) because if you
only want to monitor your own box (like me), then you don't need snmp at
all.  NetBSD's mrtg from pkgsrc comes with really neat scripts that use
netstat and sysstat to aquire the data.  All you do is copy the example
config file and add the line to crontab.  If you can't get it to work, I'd
suggest starting this way, to get it working, and then add other targets
later.

>
> On renice, generally it's best to reduce the nice
> number on something (ie lower it's priority). You
> don't want some rogue program (such as a game server,
> that's as rogue as it gets!) taking more CPU than
> otherwise useful programs your system needs to stay
> running. Rather, find the things that are taking
> priority from things you really want to not be
> interrupted, and reduce their priority. MRTG doesn't
> seem like a hugely important thing to get all the CPU
> it needs when it needs it.
>
Right, okay, I think I understand.  Its better to lower other priorities
than to raise quake3's, because it could take over the CPU and leave the
system unresponsive.  Thats simple enough.  What if I DO want quake3 to be
king tho?  When I'm in game, honestly quake3 is all I care about...it is a
home server after all, no body else to use it but me.  I'm thinking that
perhaps in this case a renice wouldnt be that bad.  I will try it both ways
for a while, and see what results I get.

> Renicing to a lower priority doesn't always mean that
> something isn't going to slow down your system though.
> If it needs I/O or access to some other pipe that is
> slow or near capacity, you're still going to get a
> slowdown.

If I renice'd mrtg, and it needed I/O access to a very slow device (like a
disk) wouldn't the kernel just switch to a process that was ready to use the
CPU?  I'm not an expert on the NetBSD kernel by a long shot, but I was under
the impression that it supported preemptive multitasking.
>
> Andy
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Search - Find what you're looking for faster
> http://search.yahoo.com
>