1
- <!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.381 2007/03/30 03: 19:02 momjian Exp $ -->
1
+ <!-- $PostgreSQL: pgsql/doc/src/sgml/runtime.sgml,v 1.382 2007/11/01 19:06:01 tgl Exp $ -->
2
2
3
3
<chapter Id="runtime">
4
4
<title>Operating System Environment</title>
@@ -478,9 +478,10 @@ psql: could not connect to server: No such file or directory
478
478
relevant for <productname>PostgreSQL</>). Almost all modern
479
479
operating systems provide these features, but not all of them have
480
480
them turned on or sufficiently sized by default, especially systems
481
- with BSD heritage. (For the <systemitem class="osname">Windows</>
482
- port, <productname>PostgreSQL</> provides its own replacement
483
- implementation of these facilities.)
481
+ with BSD heritage. (On <systemitem class="osname">Windows</>,
482
+ <productname>PostgreSQL</> provides its own replacement
483
+ implementation of these facilities, and so most of this section
484
+ can be disregarded.)
484
485
</para>
485
486
486
487
<para>
@@ -550,13 +551,13 @@ psql: could not connect to server: No such file or directory
550
551
<row>
551
552
<entry><varname>SEMMNI</></>
552
553
<entry>Maximum number of semaphore identifiers (i.e., sets)</>
553
- <entry>at least <literal>ceil(max_connections / 16)</literal></>
554
+ <entry>at least <literal>ceil(( max_connections + autovacuum_max_workers) / 16)</literal></>
554
555
</row>
555
556
556
557
<row>
557
558
<entry><varname>SEMMNS</></>
558
559
<entry>Maximum number of semaphores system-wide</>
559
- <entry><literal>ceil(max_connections / 16) * 17</literal> plus room for other applications</>
560
+ <entry><literal>ceil(( max_connections + autovacuum_max_workers) / 16) * 17</literal> plus room for other applications</>
560
561
</row>
561
562
562
563
<row>
@@ -587,18 +588,16 @@ psql: could not connect to server: No such file or directory
587
588
shared memory parameter is <varname>SHMMAX</>, the maximum size, in
588
589
bytes, of a shared memory segment. If you get an error message from
589
590
<function>shmget</> like <errorname>Invalid argument</>, it is
590
- likely that this limit has been exceeded. The size of the required
591
+ likely that this limit has been exceeded. The size of the required
591
592
shared memory segment varies depending on several
592
593
<productname>PostgreSQL</> configuration parameters, as shown in
593
- <xref linkend="shared-memory-parameters">.
594
+ <xref linkend="shared-memory-parameters">. (Any error message you might
595
+ get will include the exact size of the failed allocation request.)
594
596
You can, as a temporary solution, lower some of those settings to
595
- avoid the failure. As a rough approximation, you can estimate the
596
- required segment size as 500 kB plus the variable amounts shown in
597
- the table. (Any error message you might get will include the exact
598
- size of the failed allocation request.) While it is possible to get
597
+ avoid the failure. While it is possible to get
599
598
<productname>PostgreSQL</> to run with <varname>SHMMAX</> as small as
600
- 1 MB, you need at least 4 MB for acceptable performance, and desirable
601
- settings are in the tens of megabytes.
599
+ 2 MB, you need considerably more for acceptable performance. Desirable
600
+ settings are in the tens to hundreds of megabytes.
602
601
</para>
603
602
604
603
<para>
@@ -620,17 +619,21 @@ psql: could not connect to server: No such file or directory
620
619
621
620
<para>
622
621
<productname>PostgreSQL</> uses one semaphore per allowed connection
623
- (<xref linkend="guc-max-connections">), in sets of 16. Each such set will
622
+ (<xref linkend="guc-max-connections">) and allowed autovacuum worker
623
+ process (<xref linkend="guc-autovacuum-max-workers">), in sets of 16.
624
+ Each such set will
624
625
also contain a 17th semaphore which contains a <quote>magic
625
626
number</quote>, to detect collision with semaphore sets used by
626
627
other applications. The maximum number of semaphores in the system
627
628
is set by <varname>SEMMNS</>, which consequently must be at least
628
- as high as <varname>max_connections</> plus one extra for each 16
629
- allowed connections (see the formula in <xref
629
+ as high as <varname>max_connections</> plus
630
+ <varname>autovacuum_max_workers</>, plus one extra for each 16
631
+ allowed connections plus workers (see the formula in <xref
630
632
linkend="sysvipc-parameters">). The parameter <varname>SEMMNI</>
631
633
determines the limit on the number of semaphore sets that can
632
634
exist on the system at one time. Hence this parameter must be at
633
- least <literal>ceil(max_connections / 16)</>. Lowering the number
635
+ least <literal>ceil((max_connections + autovacuum_max_workers) / 16)</>.
636
+ Lowering the number
634
637
of allowed connections is a temporary workaround for failures,
635
638
which are usually confusingly worded <errorname>No space
636
639
left on device</>, from the function <function>semget</>.
@@ -675,7 +678,7 @@ psql: could not connect to server: No such file or directory
675
678
sort of configuration commonly used for other databases such
676
679
as <application>DB/2</application>.</para>
677
680
678
- <para> It might , however, be necessary to modify the global
681
+ <para> It might, however, be necessary to modify the global
679
682
<command>ulimit</command> information in
680
683
<filename>/etc/security/limits</filename>, as the default hard
681
684
limits for file sizes (<varname>fsize</varname>) and numbers of
@@ -865,8 +868,9 @@ options SEMMAP=256
865
868
<indexterm><primary>Linux</><secondary>IPC configuration</></>
866
869
<listitem>
867
870
<para>
868
- The default settings are only suitable for small installations
869
- (the default maximum segment size is 32 MB). However, the remaining
871
+ The default maximum segment size is 32 MB, which is only adequate
872
+ for small <productname>PostgreSQL</productname> installations.
873
+ However, the remaining
870
874
defaults are quite generously sized, and usually do not require
871
875
changes. The maximum shared memory segment size can be changed via the
872
876
<command>sysctl</command> interface. For example, to allow 128 MB,
@@ -985,7 +989,7 @@ kern.sysv.shmall=1024
985
989
<listitem>
986
990
<para>
987
991
At least in version 2.6, the default maximum size of a shared
988
- memory segments is too low for <productname>PostgreSQL</>. The
992
+ memory segment is too low for <productname>PostgreSQL</>. The
989
993
relevant settings can be changed in <filename>/etc/system</>,
990
994
for example:
991
995
<programlisting>
@@ -1051,24 +1055,29 @@ set semsys:seminfo_semmsl=32
1051
1055
<thead>
1052
1056
<row>
1053
1057
<entry>Name</>
1054
- <entry>Approximate multiplier (bytes per increment)</>
1058
+ <entry>Approximate multiplier (bytes per increment) as of 8.3 </>
1055
1059
</row>
1056
1060
</thead>
1057
1061
1058
1062
<tbody>
1059
1063
<row>
1060
1064
<entry><xref linkend="guc-max-connections"></>
1061
- <entry>400 + 270 * <xref linkend="guc-max-locks-per-transaction"></entry>
1065
+ <entry>1800 + 270 * <xref linkend="guc-max-locks-per-transaction"></entry>
1066
+ </row>
1067
+
1068
+ <row>
1069
+ <entry><xref linkend="guc-autovacuum-max-workers"></>
1070
+ <entry>1800 + 270 * <xref linkend="guc-max-locks-per-transaction"></entry>
1062
1071
</row>
1063
1072
1064
1073
<row>
1065
1074
<entry><xref linkend="guc-max-prepared-transactions"></>
1066
- <entry>600 + 270 * <xref linkend="guc-max-locks-per-transaction"></entry>
1075
+ <entry>770 + 270 * <xref linkend="guc-max-locks-per-transaction"></entry>
1067
1076
</row>
1068
1077
1069
1078
<row>
1070
1079
<entry><xref linkend="guc-shared-buffers"></>
1071
- <entry>8300 (assuming 8 kB <symbol>BLCKSZ</>)</entry>
1080
+ <entry>8400 (assuming 8 kB <symbol>BLCKSZ</>)</entry>
1072
1081
</row>
1073
1082
1074
1083
<row>
@@ -1085,6 +1094,11 @@ set semsys:seminfo_semmsl=32
1085
1094
<entry><xref linkend="guc-max-fsm-pages"></>
1086
1095
<entry>6</>
1087
1096
</row>
1097
+
1098
+ <row>
1099
+ <entry>Fixed space requirements</>
1100
+ <entry>770 kB</entry>
1101
+ </row>
1088
1102
</tbody>
1089
1103
</tgroup>
1090
1104
</table>
0 commit comments