On Sonntag 31 Mai 2009, Grant wrote: > >>>> I recently disabled swap and mounted /tmp on tmpfs for a netbook since > >>>> the SSD is so slow, and now I'm wondering if that would be a wise move > >>>> for all of my Gentoo systems. In what type of situation would it be a > >>>> bad idea? > >>> > >>> Instead of disabling swap, just make it small (like 32MB or something; > >>> whatever the smallest allowable partition size is). The kernel needs > >>> swap to operate optimally, even if it's extremely small. Just make > >>> sure it's there. > >> > >> Hmm, on this old box I noticed swap was using more than 135,000K earlier > >> today as I was emerging xulrunner and ImageMagick. I think that the > >> size of swap is relevant to the memory size that the box in question > >> has. Not all machines have found their way to 2G RAM yet ... ;) > > > > Don't forget that you can set swapiness too. This is set in > > /etc/sysctl.conf and for mine I have this: > > > > vm.swappiness = 30 > > > > The lower the number, the less chance of it using swap. If it is set to > > 90, it will use a lot of swap which is fine if you have little ram or a > > really fast drive. If it is set to 30, then it will not use swap unless > > it is basically out of ram. > > > > With the setting of 30, mine uses swap when compiling OOo or some other > > large package or if I am opening a TON of pics. Otherwise, swap is at 0 > > or close to it even after being up a long time. I have 2Gbs here tho. > > Your mileage may vary. > > > > Dale > > Thanks Dale. Should "vm.swappiness = 30" work well on all systems? > My Gentoo systems have vastly different specs and duties so I love > tweaks that always improve things. It sounds like /tmp on tmpfs is > one of those. > > - Grant
you can set swappiness = 0 which works even better, because the kernel will only swap if it really has too.