[bf1942] nice'ing processes

Rick Buford rickbuford at greeblesnort.com
Sun Feb 2 19:29:55 EST 2003


1. Nice'ing processes is, in general, not the end-all-be-all that some 
people think it is. For example, the only process that I nice most of 
the time is setiathome. I nice it to 19 simply because I don't ever want 
a process designed to max out the processor hogging resources. If your 
server does not have enough resources to run a process, nice'ing the 
process higher (more negative) will not help. It's been my experience 
that nice'ing process down (more +) has a lot more predictable results 
than trying to nice them up (more -).

2. see #1. Recently, I actually replaced my P4 file/web/mail server at 
home with an older K6-2 500 so my P4 could be freed up to do things like 
run a BF server. If you're running under 10 users with sporadic file 
service access, there's no reason to try to out-nice samba. My AMD 500 
runs web/samba/mail without any problems whatsoever, but I doubt that BF 
would run worth a dam on it with or without those services.

3. "man hdparm" - some standard "safe" performance enhancing settings:
hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdX (replace hdX with your device)
You might also try googling for "hdparm <your IDE controller> to see if 
anyone else has already done all the legwork to figure out good settings 
  for your hardware, they usually have =). On #1 & #2 regarding this 
hardware config, you should really not have to worry about nice'ing 
processes unless you're service massive amounts of users or are running 
on a 10mb nic

4. I am unfamiliar with the behavior you're describing. The only time 
I've seen screen drop a session is when I've started multiple windows 
(via .screenrc) and for some reason one of the processes dies. So far, 
everytime this has happened, it was my fault for not setting a config 
file or some such. When this happened, all of the other windows would 
show in a ^A-w and the session would be visible.

5. I would build a small script that checks for the server process every 
5 or 10 minutes, and if not found, run it. Drop that script into the 
server user's crontab (crontab -e -u <user>). In answer to the missing 
screen, my guess would be that you are trying to see the screen as a 
user, but the session is in root's screen area. Screen sessions are user 
spcific.

Hope that helps,
Rick

Boris Ceranic wrote:
> hey....
> 
> i juz want to ask you a few simple questions... they will be simple as much
> as you are experienced in linux :)
> 1. i am running ded. server under regular user acct, but when i try to
> change nice level of server application, i get an error message saying that
> i cant set priority level. how can i allow a regular user to set priority
> level for some application?
> 2. what priority level is suitable for use with these applications which
> needs greater priority level than, for example, file sharing service? can it
> be, lets say, -1, as it will be greater (or mathematicaly smaller) that
> pri.lev. of some system service?
> 3. i am running mandrake 9 linux on intel p4 1.7g, asus k7v (or so)
> mainboard, and hd drive maxtor 60gb 7200 rpm. mainboard supports ultra dma
> level6, and that limits file transfer speed at about 20mb/s (from one hdd to
> another on another ide controller), but i have JUST 1mb/s !!!!! :((((( BUT,
> when i put on mandrake 8.1, the problem disappears... (?!) any1 have an idea
> how can i solve this?
> 4. about application screening.... i use command (as regular user)
> "screen -m -S <scr_name> <app_name>", without -d parameter, just to be sure
> that everything went fine with server startup, then i detach from that
> screened app., i logout from that user running screen (and some app inside),
> and sometimes, when i login back again, i cant see screen named <scr_name>
> when doing "screen -list" command, but in "ps -A|grep screen" list, i can
> see that screen is still running under my username. but sometimes,
> everything is working fine. why?
> 5. what is the best way to start game server during the system startup, but
> under username other than root? i was using script that starts screened app
> during sys.startup, and i insert reference to this script at the end of
> rc.local or rc.sysinit files, but when i login as root, i cant attach on
> these virt. console. i can see that it still exists in /tmp/screen/S-root
> (along with its pid and screen name), but there is (as i think) no way to
> connect on it.
> 
> i am sorry because of my bad english, and thank you for help... (in advance
> :)) )
> 
> bye! poz!
> 
> ----- Original Message -----
> From: "Rick Buford" <rickbuford at greeblesnort.com>
> To: "BF1942" <bf1942 at icculus.org>
> Sent: Wednesday, January 29, 2003 5:32 AM
> Subject: [bf1942] nice'ing processes
> 
> 
> 
>>As a production linux admin for several years now, I can suggest a
>>couple of things:
>>1. NEVER RUN ANYTHING AS ROOT that you don't ABSOLUTELY have
>>too...ever...period - create a user with userad <username>; passwd
>><username>
>>2. nice'ing processes to -20 will not work for any normal
>>process...that's a level usually reserved for system processes and if
>>you disrupt them, yer gonna get hosed
>>3. clean up your system: a) remove unneeded processes if this box is
>>devoted to BF ("man ps" & "man top"); this includes GUIs. KDE & GNOME
>>are nowhere near the hogs that winblows is, but they still take system
>>resources, even if they're just sitting there to give you an xterm ("man
>>init" & "man inittab")
>>4. do not fear the command line: "man apropos", "man locate", & "man
>>find" will help you to find CLI nirvana
>>
> 
> 




More information about the Bf1942 mailing list