Update SysV IPC information.
authorPeter Eisentraut
Sun, 17 Dec 2000 11:22:00 +0000 (11:22 +0000)
committerPeter Eisentraut
Sun, 17 Dec 2000 11:22:00 +0000 (11:22 +0000)
doc/src/sgml/runtime.sgml

index ef2d250c830a9a22439a8ca67dc1d082018de10a..8e1e6bda0e6e6fc60aef38adeded78b4e58c6cea 100644 (file)
@@ -1,5 +1,5 @@
 
 
 
@@ -1300,11 +1300,12 @@ env PGOPTIONS='-c geqo=off' psql
     limits of the IPC resources then the postmaster will refuse to
     start up and should leave a marginally instructive error message
     about which problem was encountered and what needs to be done
-    about it. The relevant kernel parameters are named
+    about it.  (See also .)
+    The relevant kernel parameters are named
     consistently across different systems; 
     linkend="sysvipc-parameters"> gives an overview. The methods to
     set them, however, vary; suggestions for some platforms are given
-    below. Be aware that you will have to reboot your
+    below. Be aware that you will probably have to reboot your
     machine at least, possibly even recompile the kernel, to change these
     settings.
    
@@ -1332,13 +1333,13 @@ env PGOPTIONS='-c geqo=off' psql
       
        SHMMIN
        Minimum size of shared memory segment (bytes)
-       1 (at most 144)
+       1 (at most about 256 kB)
       
 
       
        SHMSEG
        Maximum number of shared memory segments per process
-       must be at least 3, but the default is much higher
+       only 1 segment is needed, but the default is much higher
       
 
        
@@ -1356,13 +1357,13 @@ env PGOPTIONS='-c geqo=off' psql
        
         SEMMNS
         Maximum number of semaphores system-wide
-        max_connections rounded up to multiple of 16, + room for other applications
+        ceil(max_connections / 16) * 17 + room for other applications
        
 
        
         SEMMSL
         Maximum number of semaphores per set
-        >= 16
+        >= 17
        
 
        
@@ -1396,34 +1397,36 @@ env PGOPTIONS='-c geqo=off' psql
     estimate the required segment size as the number of buffers times
     the block size (8192 kB by default) plus ample overhead (at least
     half a megabyte). Any error message you might get will contain the
-    size of the failed allocation. (Postgres will
-    actually use three shared memory segments, but the size of the
-    other two is negligible for this consideration.)
+    size of the failed allocation.
    
 
    
     Less likely to cause problems is the minimum size for shared
-    memory segments (SHMMIN), which must be at least 144
-    for Postgres (it's usually just 1), and the
-    maximum number of segments system-wide (SHMMNI, as
-    mentioned, 3 are needed) or per-process (SHMSEG,
-    ditto). Some systems also have a limit on the total amount of
-    shared memory in the system; see the platform-specific
-    instructions below.
+    memory segments (SHMMIN), which should be at most
+    somewhere around 256 kB for Postgres (it is
+    usually just 1). The maximum number of segments system-wide
+    (SHMMNI) or per-process (SHMSEG) should
+    not cause a problem unless your system has them set to zero. Some
+    systems also have a limit on the total amount of shared memory in
+    the system; see the platform-specific instructions below.
    
 
    
     Postgres uses one semaphore per allowed connection
-    (
-    semaphores in the system is set by SEMMNS, which
-    consequently must be at least as high as the connection setting.
-    The parameter SEMMNI determines the limit on the
-    number of semaphore sets that can exist on the system at one time.
-    Hence this parameter must be at least
-    ceil(max_connections / 16). Lowering the number of
-    allowed connections is a temporary workaround for failures, which
-    are usually confusingly worded No space left on
-    device, from the function semget().
+    (
+    contain a 17th semaphore which contains a magic
+    number, to avoid collision with semaphore sets used by
+    other applications. The maximum number of semaphores in the system
+    is set by SEMMNS, which consequently must be at least
+    as high as the connection setting plus one extra for each 16
+    allowed connections (see the formula in 
+    linkend="sysvipc-parameters">.  The parameter SEMMNI
+    determines the limit on the number of semaphore sets that can
+    exist on the system at one time.  Hence this parameter must be at
+    least ceil(max_connections / 16). Lowering the number
+    of allowed connections is a temporary workaround for failures,
+    which are usually confusingly worded No space
+    left on device, from the function semget().
    
 
    
@@ -1441,7 +1444,7 @@ env PGOPTIONS='-c geqo=off' psql
 
    
     The SEMMSL parameter, which determines how many
-    semaphores can be in a set, must be at least 16 for
+    semaphores can be in a set, must be at least 17 for
     Postgres.
    
 
@@ -1558,11 +1561,11 @@ options         SEMMAP=256
 
 
      
-      HPUX
+      HP-UX
       
        
         The default settings tend to suffice for normal installations.
-        On HPUX 10, the factory default for
+        On HP-UX 10, the factory default for
         SEMMNS is 128, which might be too low for larger
         database sites.
        
@@ -1581,11 +1584,23 @@ options         SEMMAP=256
       Linux
       
        
-        System V IPC is enabled by default and sufficiently sized for
-        most uses. The relevant parameters are in
+        The default shared memory limit (both
+        SHMMAX and SHMALL) is 32
+        MB in 2.2 kernels, but it can be changed in the
+        proc file system (without reboot).  For
+        example, to allow 128 MB:
+
+$ echo 134217728 >/proc/sys/kernel/shmall
+$ echo 134217728 >/proc/sys/kernel/shmmax
+
+        You could put these commands into a script run at boot-time.
+       
+
+       
+        Other parameters are sufficiently sized for any application.
+        If you want to see for yourself look into
         /usr/src/linux/include/asm-xxx/shmparam.h
-        and /usr/src/linux/include/linux/sem.h. Be sure
-        to do make dep before rebuilding the kernel.
+        and /usr/src/linux/include/linux/sem.h.