1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.218 2003/11/14 15:43:22 tgl Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.219 2003/11/16 03:38:34 tgl Exp $
3
3
-->
4
4
5
5
<Chapter Id="runtime">
@@ -1294,7 +1294,7 @@ SET ENABLE_SEQSCAN TO OFF;
1294
1294
<para>
1295
1295
Unfortunately, there is no well-defined method for determining
1296
1296
ideal values for the family of <quote>cost</quote> variables that
1297
- below. You are encouraged to experiment and share
1297
+ appear below. You are encouraged to experiment and share
1298
1298
your findings.
1299
1299
</para>
1300
1300
</note>
@@ -3267,35 +3267,36 @@ default:\
3267
3267
<title>Linux Memory Overcommit</title>
3268
3268
3269
3269
<para>
3270
- Linux kernels of version 2.4.* have a poor default memory
3271
- overcommit behavior, which can result in the PostgreSQL server
3272
- (<filename>postmaster</filename> process) being killed by the
3273
- kernel if the memory demands of another process cause the system
3274
- to run out of memory.
3270
+ In Linux 2.4, the default virtual memory behavior is not
3271
+ optimal for <productname>PostgreSQL</productname>. Because of the
3272
+ way that the kernel implements memory overcommit, the kernel may
3273
+ terminate the <productname>PostgreSQL</productname> server (the
3274
+ <filename>postmaster</filename> process) if the memory demands of
3275
+ another process cause the system to run out of virtual memory.
3275
3276
</para>
3276
3277
3277
3278
<para>
3278
- If this happens, you will see a kernel message looking like this
3279
- (consult your system documentation and configuration on where to
3280
- look for such a message):
3279
+ If this happens, you will see a kernel message that looks like
3280
+ this (consult your system documentation and configuration on where
3281
+ to look for such a message):
3281
3282
<programlisting>
3282
3283
Out of Memory: Killed process 12345 (postmaster).
3283
3284
</programlisting>
3284
- And, of course, you will find that your database server has
3285
- disappeared.
3285
+ This indicates that the <filename>postmaster</filename> process
3286
+ has been terminated due to memory pressure;
3287
+ <productname>PostgreSQL</productname> will need to be restarted.
3286
3288
</para>
3287
3289
3288
3290
<para>
3289
3291
To avoid this situation, run <productname>PostgreSQL</productname>
3290
3292
on a machine where you can be sure that other processes will not
3291
3293
run the machine out of memory. If your kernel supports the strict
3292
- and/or paranoid modes of overcommit handling, you can also relieve
3293
- this problem by altering the system's default behaviour. This can
3294
- be determined by examining the function
3295
- <function>vm_enough_memory</> in the file <filename>mm/mmap.c</>
3296
- in the kernel source. If this file reveals that the strict and/or
3297
- paranoid modes are supported by your kernel, turn one of these
3298
- modes on by using
3294
+ and/or paranoid modes of overcommit handling, you can also relieve this
3295
+ problem by altering the system's default behaviour. This can be
3296
+ determined by examining the function <function>vm_enough_memory</>
3297
+ in the file <filename>mm/mmap.c</> in the kernel source. If this
3298
+ file reveals that the strict or paranoid modes are supported by
3299
+ your kernel, turn one of these modes on by using
3299
3300
<programlisting>
3300
3301
sysctl -w vm.overcommit_memory=2
3301
3302
</programlisting>
@@ -3304,28 +3305,29 @@ sysctl -w vm.overcommit_memory=2
3304
3305
sysctl -w vm.overcommit_memory=3
3305
3306
</programlisting>
3306
3307
for paranoid mode, or placing an equivalent entry in
3307
- <filename>/etc/sysctl.conf</>.
3308
+ <filename>/etc/sysctl.conf</>. For more information on memory
3309
+ overcommit handling and the meaning of these kernel settings,
3310
+ consult the file
3311
+ <filename>Documentation/vm/overcommit-accounting</filename> in a
3312
+ recent version of the source code for the Linux kernel.
3308
3313
</para>
3309
3314
3310
3315
<caution>
3311
3316
<para>
3312
- Using these settings in a kernel which does not support these
3317
+ Using these settings with a kernel which does not support these
3313
3318
modes will almost certainly increase the danger of the kernel
3314
3319
killing the database server, rather than reducing it. If in any
3315
3320
doubt, consult a kernel expert or your kernel vendor.
3316
3321
</para>
3317
3322
</caution>
3318
3323
3319
3324
<para>
3320
- These modes are expected to be supported in all 2.6 and later
3321
- kernels. Some vendor 2.4 kernels may also support these modes. It
3322
- is, however, known that some vendor documents suggest that they
3323
- support them while examination of the kernel source reveals that
3324
- they do not.
3325
- </para>
3326
-
3327
- <para>
3328
- Note, you will need enough swap space to cover all your memory needs.
3325
+ The method described above for changing the kernel's overcommit
3326
+ behavior should work with Linux kernel versions 2.6 and later. In addition,
3327
+ some versions of the 2.4 kernel distributed by some vendors may
3328
+ also support this functionality. However, it is known that some
3329
+ vendor documents suggest that they support them while examination
3330
+ of the kernel source reveals that they do not.
3329
3331
</para>
3330
3332
</sect2>
3331
3333
</sect1>
0 commit comments