Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!bfmny0!tneff From: tneff@bfmny0.UU.NET (Tom Neff) Newsgroups: comp.unix.i386 Subject: Re: Swapping Questions Message-ID: <15184@bfmny0.UU.NET> Date: 18 Feb 90 01:04:15 GMT References: <6882@pbhyf.PacBell.COM> <21600008@adaptex> <1990Feb17.203445.12673@virtech.uucp> Reply-To: tneff@bfmny0.UU.NET (Tom Neff) Lines: 33 In article <1990Feb17.203445.12673@virtech.uucp> cpcahil@virtech.UUCP (Conor P. Cahill) writes: > One of the places where you can get program placed onto the >swap device when they aren't being run by anybody anymore is if the program >has the sticky bit set (a 't' in the others-execute slot on an ls -l >listing, set by doing a chmod 1xxx on the file). On SV3.2 versions I've seen, you can also say chmod +t filename and set the sticky (text) bit. You must be super-user. >If this is set the >text portion of the program will remain in memory (and be swapped out >to the swap device if they are no longer needed and the memory is needed >for other stuff, never to be swapped in until they are needed). Right, and the text bit is a great feature if you don't overuse it. It scores the biggest win on largish executables which you do have frequent occasion to use interactively, like vi, less, mush, or perl. The normal latency hit of loading these big fellows is eliminated! For perl especially, the difference is enormous. Setting sticky on that utility basically saved it from uselessness at my site. But the price is that everything sticky you load STAYS in memory (or the swap area) until you remove it or reboot. So you're cutting into your cache. It's a good idea to increase NBUFS and rebuild the kernel to match your typical load of sticky programs, otherwise your cache hit rate goes down noticeably. So basically you can ask, Do I love utility X enough to want to spend the RAM to keep it resident all the time barring swaps? If YES, set it sticky. (Vi and less are natural candidates.) If NO, don't bother.