More memory - less OOM situations
Posted Jun 17, 2010 22:47 UTC (Thu) by
efexis (guest, #26355)
In reply to:
More memory - less OOM situations by alsuren
Parent article:
Another OOM killer rewrite
I do, either disable or severely limit swap. The only time I ever tend to hit OOM is when something's misbehaving (infinite loop + memory leak, fork bomb etc) so I get my system back once swap's exhausted, no matter how much swap there is, it'll never be bigger than infinite, so making it big seems to have the single effect of delaying how quickly I can recover the system.
But best thing I've found to do is just put everything in seperate cgroups with memory limits set at around 80% by default, so no single thing can take out the whole system. OOM killer works just great then, killing where needs to be killed. Example cgroup report:
$ cgroup_report
CGroup Mem: Used %Full
apache 244,396K 24.43%
compile 524K 0.03%
mysql51 81,340K 8.32%
mysql55 85,756K 8.78%
netserv/courier/authdaemond 16,444K 3.28%
netserv/courier/courier 52,452K 5.24%
netserv/courier/esmtpd-msa 260K (no limit)
netserv/courier/esmtpd 2,768K 0.55%
netserv/courier/imapd 785,568K 78.55%
netserv/courier/pop3d 8,492K 0.84%
netserv/courier 0
netserv/courier/webmaild 0
netserv 176,320K 12.03%
network 300K 0.03%
rsyncd 264K 0.10%
sshd 282,904K 28.29%
system/incron 0
system 15,588K 1.55%
system/watchers/sif 1,144K 3.66%
system/watchers 0
. 6,936K (no limit)
Systems without cgroups though, yikes, when they go wrong they make my head hurt. I'm sure cgroups are the answer to everything :-p
(
Log in to post comments)