1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.431 2010/02/03 17:25:06 momjian Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.432 2010/03/13 11:00:19 petere Exp $ -->
2
2
3
3
<chapter Id="runtime">
4
4
<title>Server Setup and Operation</title>
@@ -522,9 +522,10 @@ psql: could not connect to server: No such file or directory
522
522
<quote><systemitem class="osname">System V</>
523
523
<acronym>IPC</></quote> (together with message queues, which are not
524
524
relevant for <productname>PostgreSQL</>). Almost all modern
525
- operating systems provide these features, but not all of them have
526
- them turned on or sufficiently sized by default, especially systems
527
- with a BSD heritage. (On <systemitem class="osname">Windows</>,
525
+ operating systems provide these features, but many of them don't have
526
+ them turned on or sufficiently sized by default, especially as
527
+ available RAM and the demands of database applications grow.
528
+ (On <systemitem class="osname">Windows</>,
528
529
<productname>PostgreSQL</> provides its own replacement
529
530
implementation of these facilities, so most of this section
530
531
can be disregarded.)
@@ -535,6 +536,7 @@ psql: could not connect to server: No such file or directory
535
536
<errorname>Illegal system call</> error upon server start. In
536
537
that case there is no alternative but to reconfigure your
537
538
kernel. <productname>PostgreSQL</> won't work without them.
539
+ This situation is rare, however, among modern operating systems.
538
540
</para>
539
541
540
542
<para>
@@ -546,8 +548,6 @@ psql: could not connect to server: No such file or directory
546
548
parameters are named consistently across different systems; <xref
547
549
linkend="sysvipc-parameters"> gives an overview. The methods to set
548
550
them, however, vary. Suggestions for some platforms are given below.
549
- Be warned that it is often necessary to reboot your machine, and
550
- possibly even recompile the kernel, to change these settings.
551
551
</para>
552
552
553
553
@@ -643,15 +643,15 @@ psql: could not connect to server: No such file or directory
643
643
avoid the failure. While it is possible to get
644
644
<productname>PostgreSQL</> to run with <varname>SHMMAX</> as small as
645
645
2 MB, you need considerably more for acceptable performance. Desirable
646
- settings are in the tens to hundreds of megabytes.
646
+ settings are in the hundreds of megabytes to a few gigabytes .
647
647
</para>
648
648
649
649
<para>
650
650
Some systems also have a limit on the total amount of shared memory in
651
651
the system (<varname>SHMALL</>). Make sure this is large enough
652
652
for <productname>PostgreSQL</> plus any other applications that
653
- are using shared memory segments. (Caution: <varname>SHMALL</>
654
- is measured in pages rather than bytes on many systems.)
653
+ are using shared memory segments. Note that <varname>SHMALL</>
654
+ is measured in pages rather than bytes on many systems.
655
655
</para>
656
656
657
657
<para>
@@ -898,30 +898,41 @@ options SEMMAP=256
898
898
<listitem>
899
899
<para>
900
900
The default maximum segment size is 32 MB, which is only adequate
901
- for small <productname>PostgreSQL</productname> installations.
902
- However, the remaining
903
- defaults are quite generously sized, and usually do not require
904
- changes. The maximum shared memory segment size can be changed via the
905
- <command>sysctl</command> interface. For example, to allow 128 MB,
906
- and explicitly set the maximum total shared memory size to 2097152
907
- pages (the default):
901
+ for very small <productname>PostgreSQL</productname>
902
+ installations. The default maximum total size is 2097152
903
+ pages. A page is almost always 4096 bytes except in unusual
904
+ kernel configurations with <quote>huge pages</quote>
905
+ (use <literal>getconf PAGE_SIZE</literal> to verify). That
906
+ makes a default limit of 8 GB, which is often enough, but not
907
+ always.
908
+ </para>
909
+
910
+ <para>
911
+ The shared memory size settings can be changed via the
912
+ <command>sysctl</command> interface. For example, to allow 16 GB:
908
913
<screen>
909
- <prompt>$</prompt> <userinput>sysctl -w kernel.shmmax=134217728 </userinput>
910
- <prompt>$</prompt> <userinput>sysctl -w kernel.shmall=2097152 </userinput>
914
+ <prompt>$</prompt> <userinput>sysctl -w kernel.shmmax=17179869184 </userinput>
915
+ <prompt>$</prompt> <userinput>sysctl -w kernel.shmall=4194304 </userinput>
911
916
</screen>
912
- In addition these settings can be preserved between reboots in
913
- the file <filename>/etc/sysctl.conf</filename>.
917
+ In addition these settings can be preserved between reboots in
918
+ the file <filename>/etc/sysctl.conf</filename>. Doing that is
919
+ highly recommended.
914
920
</para>
915
921
916
922
<para>
917
- Older distributions might not have the <command>sysctl</command> program,
923
+ Ancient distributions might not have the <command>sysctl</command> program,
918
924
but equivalent changes can be made by manipulating the
919
925
<filename>/proc</filename> file system:
920
926
<screen>
921
- <prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
922
- <prompt>$</prompt> <userinput>echo 2097152 >/proc/sys/kernel/shmall</userinput>
927
+ <prompt>$</prompt> <userinput>echo 17179869184 >/proc/sys/kernel/shmmax</userinput>
928
+ <prompt>$</prompt> <userinput>echo 4194304 >/proc/sys/kernel/shmall</userinput>
923
929
</screen>
924
930
</para>
931
+
932
+ <para>
933
+ The remaining defaults are quite generously sized, and usually
934
+ do not require changes.
935
+ </para>
925
936
</listitem>
926
937
</varlistentry>
927
938
0 commit comments