Gentoo Archives: gentoo-user

From: Grant <emailgrant@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] mysqld invoked oom-killer
Date: Thu, 21 Jul 2011 17:07:32
Message-Id: CAN0CFw0PGoQ2KBGVmrTsXW9NQHMjD1sNQJ95WfiVUFCTVVZypw@mail.gmail.com
In Reply to: Re: [gentoo-user] mysqld invoked oom-killer by Paul Hartman
1 >> Hi Alan, I think it was your advice I took a long time ago when I
2 >> stopped installing new machines with a swap partition and disabled it
3 >> on my already-installed machines.  Some time later, others on this
4 >> list caught wind of what I'd done and told me I was an idiot.  Is
5 >> there a consensus on this?  If the drawbacks and advantages of using
6 >> swap cancel each other out, I won't use it.
7 >
8 > I think it's basically like this:
9 >
10 > No swap = If you run out of memory, OOM-killer starts killing things
11 > "randomly" and stuff breaks.
12 >
13 > With Swap = System does not run out of memory, so things don't die,
14 > but it runs poetntially much slower during that period of high memory
15 > usage depending on your disk speed and how heavily it is leaning on
16 > swap at that moment (if it is actively trying to use more data in RAM
17 > than you physically have RAM for, it's a total slowdown disaster). If
18 > it's a case of run-away memory usage, it'll run out of swap, too,
19 > anyway, so having swap in that case only delays the OOM-killer.
20 >
21 > I think if you have 4GB of RAM you shouldn't need any swap under
22 > normal circumstances. I have a gentoo box with just 256MB of RAM
23 > that's running web server (apache + php), mail server (postfix +
24 > dovecot), and database (mariadb), and it works fine if i disable swap.
25 > I do normally have swap enabled on it, though, because emerging
26 > sometimes uses a lot of RAM.
27
28 Thanks Paul. I'm leaning toward leaving swap disabled. So I'm sure I
29 have the concept right, is adding a 1GB swap partition functionally
30 identical to adding 1GB RAM with regard to the potential for
31 out-of-memory conditions?
32
33 - Grant

Replies

Subject Author
Re: [gentoo-user] mysqld invoked oom-killer Paul Hartman <paul.hartman+gentoo@×××××.com>