LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (http://www.linuxquestions.org/questions/linux-security-4/)
-   -   oom-killer: How to set priorities to kill processes (http://www.linuxquestions.org/questions/linux-security-4/oom-killer-how-to-set-priorities-to-kill-processes-409968/)

guarriman 01-31-2006 07:26 AM

oom-killer: How to set priorities to kill processes
 
Hi.

Working with Linux 2.6.9-1.667, my server suffers periodically 'oom-killer' problems. Apache
stops working and so SSH does.

The only information I can get is within '/var/log/messages':
Jan 31 01:04:28 www kernel: oom-killer: gfp_mask=0x1d2

There are no more messages dealing with this error, and this is the memory status just 4 minutes
before (I make a 'free -m' memory log each 10 minutes):
------
01:00:01 up 27 days, 22:44, 0 users, load average: 0.39, 0.32, 0.28
total used free shared buffers cached
Mem: 496 356 139 0 32 117
-/+ buffers/cache: 206 289
Swap: 1058 74 983
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
6 0 76764 142972 33228 120612 1 1 15 23 12 9 16 2 81 1
0 0 76764 143076 33396 120640 0 0 0 2668 1300 1674 50 15 34 1
0 0 76764 143076 33396 120640 0 0 0 0 1015 20 0 0 100 0
0 0 76764 143076 33396 120640 0 0 0 0 1020 35 0 0 100 0
0 0 76764 143076 33396 120640 0 0 0 0 1040 339 28 4 68 0
-----------
I consider it as a normal status, isn't it?

Is there any posibility to set priorities in order to make oom-killer stop
the processes I want? I don't want it to stop 'httpd' or 'sshd'.

Thank you very much.

unSpawn 01-31-2006 09:03 AM

First of all please upgrade to kernel 2.6.15.2.
It may not solve *this* problem, but it will fix vulnerabilities.

Second this is no security question and so should better be in Linux - General with your old thread and I will move this thread there. If you think it's beneficial to merge the two threads ask


You haven't posted much info to go on like when/after which changes this started happening, CPU and process specs, dmesg, HW, drivers, SW in use, etc, etc and the kernel should start spewing messages right after and before activating Out Of Memory killing. Since in your old thread for instance sendmail shows a reject because of high load I don't think the stats you show are useful. I would suggest running continuous stats with vmstat or install more comprehensive tools like Dstat or Atsar, removing all non-critical services from restarting (not syslog and friends but httpd, mysqld, y'know), rebooting the box after installing the latest stable kernel and start monitoring. If it doesn't crash (wait and use the box for say half a day) enable each service, use it and wait a reasonable period (say half a day) before reenabling the next service. When you crash the box you've got some nice dstat numbers to graph in OOo Calc to draw conclusions from and a more approximate idea what the culprit(s) could be, but that's just my 2 cents.


All times are GMT -5. The time now is 11:07 PM.