Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] To swap or not to swap? Is it really needed?
Date: Fri, 30 Dec 2011 00:05:23
Message-Id: CAEH5T2MuS3fkaV4U_f=gE64NHd-puE98gK40K3tDKw3qzJaRxw@mail.gmail.com
In Reply to: Re: [gentoo-user] To swap or not to swap? Is it really needed? by "Claudio Roberto França Pereira"
1 On Thu, Dec 29, 2011 at 5:11 PM, Claudio Roberto França Pereira
2 <spideybr@×××××.com> wrote:
3 > Sorry for being so general, for not giving any real info. I'm new to
4 > system monitoring, I just learnt about iostat and swapon -s, now about
5 > vmstat. I mainly tried to catch anything unusual in top/htop.
6 >
7 > Trying to be more specifically, my system is a core 2 duo, dual core
8 > 3ghz processor, 4gb of ram (now 2gb), ATI radeon HD4850 with 512mb of
9 > vram. I used to play a lot on this box, now a lot less. On Gentoo,
10 > when I play is some browser game or cowsay (it's in games-misc!), not
11 > anything relevant. I'm using radeon open source drivers, by the way.
12 > My main use, currently, is web surfing, firefox with LOTS of tabs,
13 > email, social networks and random browsing. Firefox alone uses lots of
14 > ram, almost always it's using more than a half GB, sometimes it passes
15 > the 1gb mark. I also do Qt develop on this, but nothing heavy. No
16 > virtual machines, no 3d rendering, no heavy processing, no
17 > hibernation.
18 >
19 > So, I'm just a basic common web surfer. In this case, can I say it's
20 > at least SAFE to disable swap? I'll look into "last month's" thread on
21 > this.
22 >
23
24 Safe to disable, sure. "swapoff" your device(s) and see how it goes.
25 If you start to get out-of-memory errors, you know you've made the
26 wrong decision. :)
27
28 I think general opinion is that swap is slow and kills performance,
29 you want to avoid it happening if at all possible. If you have enough
30 RAM to avoid using it entirely, great. Tuning the sysctl settings like
31 Dale said, while still having swap partition "just in case" is the way
32 I'd go. If the system is swapping all the time, maybe you just need
33 more RAM.
34
35 While you're looking at recent threads, check the one about ZRAM also.
36 It is a good alternative to (or complement to) disk-based swap, if
37 your normal swap usage is less than the amount of ZRAM you've
38 allocated.
39
40 Some things, like suspend-to-disk, might require a swap device
41 on-disk. I have never used that feature myself, so I'm not familiar
42 with the details.

Replies

Subject Author
Re: [gentoo-user] To swap or not to swap? Is it really needed? "Claudio Roberto França Pereira" <spideybr@×××××.com>