mirror of
https://github.com/postgres/postgres.git
synced 2025-06-02 00:01:40 -04:00
Add more information about avoiding Linux OOM killer.
by Toru SHIMOGAKI
This commit is contained in:
parent
a535cdf130
commit
f12f220e5a
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.378 2007/02/16 16:37:29 tgl Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.379 2007/03/06 09:54:23 petere Exp $ -->
|
||||||
|
|
||||||
<chapter Id="runtime">
|
<chapter Id="runtime">
|
||||||
<title>Operating System Environment</title>
|
<title>Operating System Environment</title>
|
||||||
@ -1201,15 +1201,21 @@ Out of Memory: Killed process 12345 (postgres).
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
One way to avoid this problem is to run
|
One way to avoid this problem is to run
|
||||||
<productname>PostgreSQL</productname>
|
<productname>PostgreSQL</productname> on a machine where you can
|
||||||
on a machine where you can be sure that other processes will not
|
be sure that other processes will not run the machine out of
|
||||||
run the machine out of memory.
|
memory. If memory is tight, increasing the swap space of the
|
||||||
|
operating system can help avoiding the problem, because the
|
||||||
|
out-of-memory (OOM) killer is invoked whenever physical memory and
|
||||||
|
swap space are exhausted.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
On Linux 2.6 and later, a better solution is to modify the kernel's
|
On Linux 2.6 and later, an additional measure is to modify the
|
||||||
behavior so that it will not <quote>overcommit</> memory. This is
|
kernel's behavior so that it will not <quote>overcommit</> memory.
|
||||||
done by selecting strict overcommit mode via <command>sysctl</command>:
|
Although this setting will not prevent the OOM killer from
|
||||||
|
invoking altogether, it will lower the chances significantly and
|
||||||
|
will therefore lead to more robust system behavior. This is done
|
||||||
|
by selecting strict overcommit mode via <command>sysctl</command>:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
sysctl -w vm.overcommit_memory=2
|
sysctl -w vm.overcommit_memory=2
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user