From: | "Ron Mayer" <ron(at)intervideo(dot)com> |
---|---|
To: | "Jeroen T(dot) Vermeulen" <jtv(at)xs4all(dot)nl>, "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Greg Stark" <gsstark(at)mit(dot)edu>, <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Pre-allocation of shared memory ... |
Date: | 2003-06-13 02:22:14 |
Message-ID: | POEDIPIPKGJJLDNIEMBEKELGCPAA.ron@intervideo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Jeroen T. Vermeulen wrote:
>
>After that, where do you go? Try to find a reasonable process to shoot
>in the head. From what I heard, although I haven't kept current, a lot
>of work went into selecting a "reasonable" process, so there will be some
>determinism.
FWIW, you can browse the logic linux uses to choose
which process to kill here:
http://lxr.linux.no/source/mm/oom_kill.c
If I read that right, this calculates "points" for each process, where:
points = vm_size_of_process
/ sqrt(cpu_time_it_ran)
/ sqrt(sqrt(clock_time_it_had)
* 2 if the process was niced
/ 4 if the process ran a root
/ 4 if the process had hardware access.
and whichever process has the most points dies.
I'm guessing any database backend (postgres, oracle)
that wasn't part of a long-lived connection seems like
an especially attractive target to this algorithm.
(Though hopefully it's all moot now that Andrew / Tom
found/recommended the paranoid overcommit option, which
sure seems like the most sane thing for a server to me)
Ron
PS: Oracle DBAs suffer from the same pain.
http://www.cs.helsinki.fi/linux/linux-kernel/2001-12/0098.html
http://www.ussg.iu.edu/hypermail/linux/kernel/0103.3/0094.html
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-06-13 02:22:17 | Re: CVS -Tip compile issue -- FreeBSD 4.8 |
Previous Message | Bruce Momjian | 2003-06-13 02:11:39 | Re: Pre-allocation of shared memory ... |