On Tue, 1 Feb 2011, da...@lang.hm wrote: > Background (and I'm sure folks who have been around longer can add more to > this, but I think it does a fair job of summarizing the history) > > On some kernels (linux and *nix) the virtual memory system reserved a page > in swap for every page in ram, and as a result if swap < ram your > addressable memory was then limited to the amount of swap space you have. [....etc...]
yep. on solaris you used to have to account for memory that was allocated by malloc()/brk() and was still not used in swap. the design seemed to be such that you would error out of malloc() rather than go to dirty a page and error on the page fault. linux plays faster and looser so you might OOM on a random page fault, and then you need the oom-killer to guess who was most at fault -- but you could malloc() a petabyte (on a 64-bit server) and the O/S would be fine with that as long you didn't use it all... > My opinion on 'Best Practice': > > all that being said, on my servers I allocate 2G of disk to swap. I don't > do suspend on these systems, and I figure that if I'm swapping badly > enough to use 2G of swap space, the machine is probably so slow that it's > unusuable anyway. I would seriously consider going swapless, but there > have been occasional (every couple of years) bugs in the linux VM system > that make the 'elbow room' issue significant, and I occasionally have some > process in my standard build that isn't needed in one location, so letting > it migrate to swap so that other things can use the ram helps a little > bit. most everything that I do is low-latency request/response HTTP REST-ish services that if they ever swap the game is basically over. i don't deal with any images that would ever need to suspend. i tend to use about swap = 1/2 RAM up to a max of 2GB of swap. i've got some 32GB RAM images running with 2GB of swap just fine. we've also got some servers that really need the split-LRU VM stuff in RHEL6 to make the 'swappiness' tunable work in a useful way. we've run those servers entirely swapless since about 8/2009 now and its been fine. (https://bugzilla.redhat.com/show_bug.cgi?id=160033 for gory details) there are literally a TON of these kinds of "RULES" that system admins adhere to that drive me nuts. things that terrify SAs that i have no problems with: - swapless servers - operational/QA folks in dev orgs pushing code (you still have separation of duties) - one-big-slash filesystems - installing compilers on every server - installing many, many default RPMs by default creating a 'bloated' O/S install i can probably think of more but thats enough for a couple weeks of flamewars... _______________________________________________ Discuss mailing list Discuss@lists.lopsa.org https://lists.lopsa.org/cgi-bin/mailman/listinfo/discuss This list provided by the League of Professional System Administrators http://lopsa.org/