Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Cc: Grant <emailgrant@×××××.com>
Subject: Re: [gentoo-user] mysqld invoked oom-killer
Date: Wed, 20 Jul 2011 22:14:38
Message-Id: 5380544.drBLm2DLuO@nazgul
In Reply to: [gentoo-user] mysqld invoked oom-killer by Grant
1 On Wednesday 20 July 2011 13:30:05 Grant did opine thusly:
2 > I ran into an out of memory problem. The first mention of it in the
3 > kernel log is "mysqld invoked oom-killer". I haven't run into this
4 > before. I do have a swap partition but I don't activate it based
5 > on something I read previously that I later found out was wrong so
6 > I suppose I should activate it. Is fstab the way to do that? I
7 > have a commented line in there for swap.
8 >
9 > Can anyone tell how much swap this is:
10 >
11 > /dev/sda2 80325 1140614 530145 82 Linux swap /
12 > Solaris
13 >
14 > If it's something like 512MB, that may not have prevented me from
15 > running out of memory since I have 4GB RAM. Is there any way to
16 > find out if there was a memory leak or other problem that should be
17 > investigated?
18
19 To activate swap, put a line in fstab like so:
20
21 /dev/sda2 none swap sw 0 0
22
23 However, you do not want to use it. it is not the life-saver some
24 howto authors on the internet claim it to be.
25
26 When a linux machine hits swap, it does so very aggressively, there is
27 nothing nice about it at all. The entire machine slows to a
28 painstaking crawl for easily a minute at a time while the kernel
29 writes pages out to disk, and disk is thousands of times slower than
30 RAM.
31
32 It gets so bad that you can't even run a shell properly to try and see
33 what's going on and kill the actual memory hog.
34
35 My personal rule of thumb: if you hit swap, the bad thing has already
36 gone very very south, usually to the point where you can't do much
37 about it and it's already too late. Besides, that bastard deomon spawn
38 of satan called the oom-killer is likely about to kick in and REALLY
39 make your day. Anyone else notice how oom-killer seems to be hard
40 coded to zap the most inconvenient process of all?.....
41
42 What you need to be doing is monitor your memory usage during normal
43 conditions and deal with issues before they become problems.
44
45
46 --
47 alan dot mckinnon at gmail dot com

Replies

Subject Author
Re: [gentoo-user] mysqld invoked oom-killer Grant <emailgrant@×××××.com>