Re: doc patch - linux memory handling

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: doc patch - linux memory handling
Дата
Msg-id 3F464227.2090103@dunslane.net
обсуждение исходный текст
Ответ на Re: doc patch - linux memory handling  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: doc patch - linux memory handling  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
It appears we are back in the "you need a non-empty password" mode.

Anyway, here's the revised patch.

andrew


Andrew Dunstan wrote:

>
> I didn't find a single instance of a <warning> tag in the doc sources.
> I did find a warning in an unadorned para, in func.sgml.
>
> Anyway, I made the changes (using <note>) but anoncvs is now refusing
> my login attempt, so I can't do the diff.
>
> I've spent way too much time on this already - really my only concern
> was that the docs would give people info that would make things worse
> rather than better, and nobody else was doing anything about it.
>
> cheers
>
> andrew
>

Index: doc/src/sgml/runtime.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/runtime.sgml,v
retrieving revision 1.200
diff -c -w -r1.200 runtime.sgml
*** doc/src/sgml/runtime.sgml    17 Aug 2003 22:19:10 -0000    1.200
--- doc/src/sgml/runtime.sgml    22 Aug 2003 16:14:47 -0000
***************
*** 3068,3081 ****
         </para>

         <para>
!         Linux has poor default memory overcommit behavior.  Rather than
!         failing if it can not reserve enough memory, it returns success,
!         but later fails when the memory can't be mapped and terminates
!         the application with <literal>kill -9</>.  To prevent unpredictable
!         process termination, use:
  <programlisting>
  sysctl -w vm.overcommit_memory=3
  </programlisting>
          Note, you will need enough swap space to cover all your memory needs.
         </para>
        </listitem>
--- 3068,3128 ----
         </para>

         <para>
!     Linux kernel version 2.4.* has poor default memory overcommit
!     behavior, which can result in the postmaster being killed by the
!     kernel due to memory demands by another process if the system
!     runs out of memory.
!     </para>
!
!        <para>
!     The symptom of this occuring is a kernel message looking like
!     this (consult your system documentation and configuration on
!     where to look for such a message):
! <programlisting>
!  Out of Memory: Killed process 12345 (postmaster).
! </programlisting>
!     </para>
!
!        <para>
!     To avoid this situation, run <productname>PostgreSQL</productname>
!     on a machine where you
!     can be sure that other processes will not run the machine out
!     of memory. If your kernel supports strict and/or paranoid modes
!     of overcommit handling, you can also relieve this problem by
!     altering the system's default behaviour. This can be determined
!     by examining the function <function>vm_enough_memory</>
!     in the file <filename>mm/mmap.c</>in the kernel source.
!     If this file reveals that strict and/or paranoid modes are
!     supported by your kernel, turn one of these modes on by using
! <programlisting>
! sysctl -w vm.overcommit_memory=2
! </programlisting>
!      for strict mode or
  <programlisting>
  sysctl -w vm.overcommit_memory=3
  </programlisting>
+     for paranoid mode, or placing an equivalent entry in
+     <filename>/etc/sysctl.conf</>.
+     </para>
+
+        <note>
+     <para>
+      Warning: using these settings in a kernel which does not support
+      these modes will almost certainly increase the danger of the
+      kernel killing the postmaster, rather than reducing it.
+      If in any doubt, consult a kernel expert or your kernel vendor.
+     </para>
+        </note>
+
+        <para>
+     These modes are expected to be supported in all 2.6 and later
+     kernels. Some vendor 2.4 kernels may also support these modes.
+     However, it is known that some vendor documents suggest that
+     they support them while examination of the kernel source reveals
+     that they do not.
+     </para>
+
+        <para>
          Note, you will need enough swap space to cover all your memory needs.
         </para>
        </listitem>

В списке pgsql-patches по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: doc patch - linux memory handling
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: doc patch - linux memory handling