Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Disabling swap & mounting /tmp on tmpfs = new standard?
Date: Sun, 31 May 2009 00:46:28
Message-Id: 49bf44f10905301746t22d92952pb6672b6f4808f942@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: Disabling swap & mounting /tmp on tmpfs = new standard? by Dale
1 >>>> I recently disabled swap and mounted /tmp on tmpfs for a netbook since
2 >>>> the SSD is so slow, and now I'm wondering if that would be a wise move
3 >>>> for all of my Gentoo systems.  In what type of situation would it be a
4 >>>> bad idea?
5 >>>>
6 >>> Instead of disabling swap, just make it small (like 32MB or something;
7 >>> whatever the smallest allowable partition size is).  The kernel needs
8 >>> swap to operate optimally, even if it's extremely small.  Just make sure
9 >>> it's there.
10 >>>
11 >>
12 >> Hmm, on this old box I noticed swap was using more than 135,000K earlier today
13 >> as I was emerging xulrunner and ImageMagick.  I think that the size of swap
14 >> is relevant to the memory size that the box in question has.  Not all
15 >> machines have found their way to 2G RAM yet ... ;)
16 >>
17 >>
18 >
19 > Don't forget that you can set swapiness too.  This is set in
20 > /etc/sysctl.conf and for mine I have this:
21 >
22 > vm.swappiness = 30
23 >
24 > The lower the number, the less chance of it using swap.  If it is set to
25 > 90, it will use a lot of swap which is fine if you have little ram or a
26 > really fast drive.  If it is set to 30, then it will not use swap unless
27 > it is basically out of ram.
28 >
29 > With the setting of 30, mine uses swap when compiling OOo or some other
30 > large package or if I am opening a TON of pics.  Otherwise, swap is at 0
31 > or close to it even after being up a long time.  I have 2Gbs here tho.
32 > Your mileage may vary.
33 >
34 > Dale
35
36 Thanks Dale. Should "vm.swappiness = 30" work well on all systems?
37 My Gentoo systems have vastly different specs and duties so I love
38 tweaks that always improve things. It sounds like /tmp on tmpfs is
39 one of those.
40
41 - Grant

Replies

Subject Author
Re: [gentoo-user] Re: Disabling swap & mounting /tmp on tmpfs = new standard? Dale <rdalek1967@×××××.com>
Re: [gentoo-user] Re: Disabling swap & mounting /tmp on tmpfs = new standard? Volker Armin Hemmann <volkerarmin@××××××××××.com>