1
1
<!--
2
- $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.41 2000/12/03 14:36:45 petere Exp $
2
+ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.42 2000/12/17 11:22:00 petere Exp $
3
3
-->
4
4
5
5
<Chapter Id="runtime">
@@ -1300,11 +1300,12 @@ env PGOPTIONS='-c geqo=off' psql
1300
1300
limits of the IPC resources then the postmaster will refuse to
1301
1301
start up and should leave a marginally instructive error message
1302
1302
about which problem was encountered and what needs to be done
1303
- about it. The relevant kernel parameters are named
1303
+ about it. (See also <xref linkend="postmaster-start-failures">.)
1304
+ The relevant kernel parameters are named
1304
1305
consistently across different systems; <xref
1305
1306
linkend="sysvipc-parameters"> gives an overview. The methods to
1306
1307
set them, however, vary; suggestions for some platforms are given
1307
- below. Be aware that you will have to reboot your
1308
+ below. Be aware that you will probably have to reboot your
1308
1309
machine at least, possibly even recompile the kernel, to change these
1309
1310
settings.
1310
1311
</para>
@@ -1332,13 +1333,13 @@ env PGOPTIONS='-c geqo=off' psql
1332
1333
<row>
1333
1334
<entry><varname>SHMMIN</></>
1334
1335
<entry>Minimum size of shared memory segment (bytes)</>
1335
- <entry>1 (at most 144 )</>
1336
+ <entry>1 (at most about 256 kB )</>
1336
1337
</row>
1337
1338
1338
1339
<row>
1339
1340
<entry><varname>SHMSEG</></>
1340
1341
<entry>Maximum number of shared memory segments per process</>
1341
- <entry>must be at least 3 , but the default is much higher</>
1342
+ <entry>only 1 segment is needed , but the default is much higher</>
1342
1343
</row>
1343
1344
1344
1345
<row>
@@ -1356,13 +1357,13 @@ env PGOPTIONS='-c geqo=off' psql
1356
1357
<row>
1357
1358
<entry><varname>SEMMNS</></>
1358
1359
<entry>Maximum number of semaphores system-wide</>
1359
- <entry>max_connections rounded up to multiple of 16, + room for other applications</>
1360
+ <entry>ceil( max_connections / 16) * 17 + room for other applications</>
1360
1361
</row>
1361
1362
1362
1363
<row>
1363
1364
<entry><varname>SEMMSL</></>
1364
1365
<entry>Maximum number of semaphores per set</>
1365
- <entry>>= 16 </>
1366
+ <entry>>= 17 </>
1366
1367
</row>
1367
1368
1368
1369
<row>
@@ -1396,34 +1397,36 @@ env PGOPTIONS='-c geqo=off' psql
1396
1397
estimate the required segment size as the number of buffers times
1397
1398
the block size (8192 kB by default) plus ample overhead (at least
1398
1399
half a megabyte). Any error message you might get will contain the
1399
- size of the failed allocation. (<productname>Postgres</> will
1400
- actually use three shared memory segments, but the size of the
1401
- other two is negligible for this consideration.)
1400
+ size of the failed allocation.
1402
1401
</para>
1403
1402
1404
1403
<para>
1405
1404
Less likely to cause problems is the minimum size for shared
1406
- memory segments (<varname>SHMMIN</>), which must be at least 144
1407
- for <productname>Postgres</> (it's usually just 1), and the
1408
- maximum number of segments system-wide (<varname>SHMMNI</>, as
1409
- mentioned, 3 are needed ) or per-process (<varname>SHMSEG</>,
1410
- ditto). Some systems also have a limit on the total amount of
1411
- shared memory in the system; see the platform-specific
1412
- instructions below.
1405
+ memory segments (<varname>SHMMIN</>), which should be at most
1406
+ somewhere around 256 kB for <productname>Postgres</> (it is
1407
+ usually just 1). The maximum number of segments system-wide
1408
+ (<varname>SHMMNI</> ) or per-process (<varname>SHMSEG</>) should
1409
+ not cause a problem unless your system has them set to zero. Some
1410
+ systems also have a limit on the total amount of shared memory in
1411
+ the system; see the platform-specific instructions below.
1413
1412
</para>
1414
1413
1415
1414
<para>
1416
1415
<productname>Postgres</> uses one semaphore per allowed connection
1417
- (<option>-N</> option), in sets of 16. The maximum number of
1418
- semaphores in the system is set by <varname>SEMMNS</>, which
1419
- consequently must be at least as high as the connection setting.
1420
- The parameter <varname>SEMMNI</> determines the limit on the
1421
- number of semaphore sets that can exist on the system at one time.
1422
- Hence this parameter must be at least
1423
- <literal>ceil(max_connections / 16)</>. Lowering the number of
1424
- allowed connections is a temporary workaround for failures, which
1425
- are usually confusingly worded <quote><errorname>No space left on
1426
- device</></>, from the function <function>semget()</>.
1416
+ (<option>-N</> option), in sets of 16. Each such set will also
1417
+ contain a 17th semaphore which contains a <quote>magic
1418
+ number</quote>, to avoid collision with semaphore sets used by
1419
+ other applications. The maximum number of semaphores in the system
1420
+ is set by <varname>SEMMNS</>, which consequently must be at least
1421
+ as high as the connection setting plus one extra for each 16
1422
+ allowed connections (see the formula in <xref
1423
+ linkend="sysvipc-parameters">. The parameter <varname>SEMMNI</>
1424
+ determines the limit on the number of semaphore sets that can
1425
+ exist on the system at one time. Hence this parameter must be at
1426
+ least <literal>ceil(max_connections / 16)</>. Lowering the number
1427
+ of allowed connections is a temporary workaround for failures,
1428
+ which are usually confusingly worded <quote><errorname>No space
1429
+ left on device</></>, from the function <function>semget()</>.
1427
1430
</para>
1428
1431
1429
1432
<para>
@@ -1441,7 +1444,7 @@ env PGOPTIONS='-c geqo=off' psql
1441
1444
1442
1445
<para>
1443
1446
The <varname>SEMMSL</> parameter, which determines how many
1444
- semaphores can be in a set, must be at least 16 for
1447
+ semaphores can be in a set, must be at least 17 for
1445
1448
<productname>Postgres</>.
1446
1449
</para>
1447
1450
@@ -1558,11 +1561,11 @@ options SEMMAP=256
1558
1561
1559
1562
1560
1563
<varlistentry>
1561
- <term>HPUX </>
1564
+ <term>HP-UX </>
1562
1565
<listitem>
1563
1566
<para>
1564
1567
The default settings tend to suffice for normal installations.
1565
- On <productname>HPUX </> 10, the factory default for
1568
+ On <productname>HP-UX </> 10, the factory default for
1566
1569
<varname>SEMMNS</> is 128, which might be too low for larger
1567
1570
database sites.
1568
1571
</para>
@@ -1581,11 +1584,23 @@ options SEMMAP=256
1581
1584
<term>Linux</>
1582
1585
<listitem>
1583
1586
<para>
1584
- System V IPC is enabled by default and sufficiently sized for
1585
- most uses. The relevant parameters are in
1587
+ The default shared memory limit (both
1588
+ <varname>SHMMAX</varname> and <varname>SHMALL</varname>) is 32
1589
+ MB in 2.2 kernels, but it can be changed in the
1590
+ <filename>proc</filename> file system (without reboot). For
1591
+ example, to allow 128 MB:
1592
+ <screen>
1593
+ <prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmall</userinput>
1594
+ <prompt>$</prompt> <userinput>echo 134217728 >/proc/sys/kernel/shmmax</userinput>
1595
+ </screen>
1596
+ You could put these commands into a script run at boot-time.
1597
+ </para>
1598
+
1599
+ <para>
1600
+ Other parameters are sufficiently sized for any application.
1601
+ If you want to see for yourself look into
1586
1602
<filename>/usr/src/linux/include/asm-<replaceable>xxx</>/shmparam.h</>
1587
- and <filename>/usr/src/linux/include/linux/sem.h</>. Be sure
1588
- to do <command>make dep</> before rebuilding the kernel.
1603
+ and <filename>/usr/src/linux/include/linux/sem.h</>.
1589
1604
</para>
1590
1605
</listitem>
1591
1606
</varlistentry>
0 commit comments