11<!--
2- $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.57 2001/03/16 05:44:33 tgl Exp $
2+ $Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.58 2001/03/24 00:24:26 tgl Exp $
33-->
44
55<Chapter Id="runtime">
@@ -165,7 +165,7 @@ NOTICE: Initializing database with en_US collation order.
165165 </para>
166166
167167 <para>
168- This shells syntax can get tedious quickly. Therefore the shell
168+ This shell syntax can get tedious quickly. Therefore the shell
169169 script wrapper <application>pg_ctl</application> is provided that
170170 encapsulates some of the tasks. E.g.,
171171<programlisting>
@@ -266,10 +266,10 @@ su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgs
266266 </para>
267267
268268 <para>
269- While the <application>postmaster</application> is running, it's
269+ While the <application>postmaster</application> is running, its
270270 PID is in the file <filename>postmaster.pid</filename> in the data
271- directory. This is used as in interlock against multiple running
272- postmaster on the same data directory and can also be used for
271+ directory. This is used as an interlock against multiple postmasters
272+ running in the same data directory, and can also be used for
273273 shutting down the postmaster.
274274 </para>
275275
@@ -364,8 +364,9 @@ IpcSemaphoreCreate: semget(key=5440026, num=16, 01600) failed: No space left on
364364
365365 <para>
366366<screen>
367- connectDB() -- connect() failed: Connection refused
368- Is the postmaster running (with -i) at 'server.joe.com' and accepting connections on TCP/IP port 5432?
367+ PQconnectPoll() -- connect() failed: Connection refused
368+ Is the postmaster running (with -i) at 'server.joe.com'
369+ and accepting connections on TCP/IP port 5432?
369370</screen>
370371 This is the generic <quote>I couldn't find a server to talk
371372 to</quote> failure. It looks like the above when TCP/IP
@@ -378,8 +379,9 @@ Is the postmaster running (with -i) at 'server.joe.com' and accepting connection
378379 Alternatively, you'll get this when attempting
379380 Unix-socket communication to a local postmaster:
380381<screen>
381- connectDB() -- connect() failed: No such file or directory
382- Is the postmaster running locally and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
382+ connectDBstart() -- connect() failed: No such file or directory
383+ Is the postmaster running locally
384+ and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
383385</screen>
384386 </para>
385387
@@ -454,6 +456,8 @@ syslog = 2
454456postmaster -c log_connections=yes -c syslog=2
455457</programlisting>
456458 which would have the same effect as the previous example.
459+ Command-line options override any conflicting settings in
460+ <filename>postgresql.conf</filename>.
457461 </para>
458462
459463 <para>
@@ -1066,7 +1070,9 @@ env PGOPTIONS='-c geqo=off' psql
10661070 that for a complex query, several sorts and/or hashes might be
10671071 running in parallel, and each one will be allowed to use as
10681072 much memory as this value specifies before it starts to put
1069- data into temporary files.
1073+ data into temporary files. And don't forget that each running
1074+ backend could be doing one or more sorts. So the total memory
1075+ space needed could be many times the value of SORT_MEM.
10701076 </para>
10711077 </listitem>
10721078 </varlistentry>
@@ -1396,7 +1402,7 @@ env PGOPTIONS='-c geqo=off' psql
13961402 not relevant for <productname>Postgres</>). Almost all modern
13971403 operating systems provide these features, but not all of them have
13981404 them turned on or sufficiently sized by default, especially
1399- systems with BSD heritage. (For the QNX port ,
1405+ systems with BSD heritage. (For the QNX and BeOS ports ,
14001406 <productname>Postgres</> provides its own replacement
14011407 implementation of these facilities.)
14021408 </para>
@@ -1510,7 +1516,7 @@ env PGOPTIONS='-c geqo=off' psql
15101516 estimate the required segment size as the number of buffers times
15111517 the block size (8192 kB by default) plus ample overhead (at least
15121518 half a megabyte). Any error message you might get will contain the
1513- size of the failed allocation.
1519+ size of the failed allocation request .
15141520 </para>
15151521
15161522 <para>
@@ -1533,7 +1539,7 @@ env PGOPTIONS='-c geqo=off' psql
15331539 is set by <varname>SEMMNS</>, which consequently must be at least
15341540 as high as the connection setting plus one extra for each 16
15351541 allowed connections (see the formula in <xref
1536- linkend="sysvipc-parameters">. The parameter <varname>SEMMNI</>
1542+ linkend="sysvipc-parameters">) . The parameter <varname>SEMMNI</>
15371543 determines the limit on the number of semaphore sets that can
15381544 exist on the system at one time. Hence this parameter must be at
15391545 least <literal>ceil(max_connections / 16)</>. Lowering the number
@@ -1588,7 +1594,7 @@ env PGOPTIONS='-c geqo=off' psql
15881594#define SHMALL /* max amount of shared memory (pages) */
15891595</programlisting>
15901596
1591- To increase the number of buffers supported by the postmaseter , add the
1597+ To increase the number of buffers supported by the postmaster , add the
15921598 following to your kernel config file. A <varname>SHMALL</> value of 1024
15931599 represents 4MB of shared memory. Increase it accordingly:
15941600<programlisting>
@@ -1621,9 +1627,8 @@ options "SYSPTSIZE=13"
16211627 <title>Semaphores</>
16221628 <para>
16231629 You may need to increase the number of semaphores. By
1624- default, <productname>Postgres</> allocates 32 semaphores,
1625- one for each backend connection. This is just over half the
1626- default system total of 60.
1630+ default, <productname>Postgres</> allocates 34 semaphores,
1631+ which is over half the default system total of 60.
16271632 </para>
16281633 </formalpara>
16291634
@@ -1845,7 +1850,7 @@ set semsys:seminfo_semmsl=32
18451850 counts but it can be changed by the user up to the hard limit.
18461851 The hard limit can only be changed by the root user. The system
18471852 call <function>setrlimit</function> is responsible for setting
1848- these parameters. The shell the built-in command
1853+ these parameters. The shell's built-in command
18491854 <command>ulimit</command> (Bourne shells) or
18501855 <command>limit</command> (csh) is used to control the resource
18511856 limits from the command line. On BSD-derived systems the file
@@ -1922,8 +1927,9 @@ default:\
19221927 <listitem>
19231928 <para>
19241929 After receiving SIGTERM, the postmaster disallows new
1925- connections but lets active backend end their work and shuts
1926- down only after all of them terminated (by client request).
1930+ connections, but lets existing backends end their work normally.
1931+ It shuts down only after all of the backends terminate by client
1932+ request.
19271933 This is the <firstterm>Smart Shutdown</firstterm>.
19281934 </para>
19291935 </listitem>
@@ -1933,10 +1939,11 @@ default:\
19331939 <term>SIGINT</term>
19341940 <listitem>
19351941 <para>
1936- The postmaster disallows new connections, sends all active
1937- backends SIGTERM (which will cause them to abort immediately),
1938- waits for children to exit and shuts down the data base. This
1939- is the <firstterm>Fast Shutdown</firstterm>.
1942+ The postmaster disallows new connections and sends all existing
1943+ backends SIGTERM, which will cause them to abort their current
1944+ transactions and exit promptly. It then waits for the backends to exit
1945+ and finally shuts down the data base.
1946+ This is the <firstterm>Fast Shutdown</firstterm>.
19401947 </para>
19411948 </listitem>
19421949 </varlistentry>
@@ -1948,19 +1955,19 @@ default:\
19481955 This is the <firstterm>Immediate Shutdown</firstterm> which
19491956 will cause the postmaster to send a SIGQUIT to all backends and
19501957 exit immediately (without properly shutting down the database
1951- system). When WAL is implemented, this will lead to recovery on
1952- start-up. Right now it's not recommendable to use this option.
1958+ system). The backends likewise exit immediately upon receiving
1959+ SIGQUIT. This will lead to recovery (by replaying the WAL log)
1960+ upon next start-up. This is recommended only in emergencies.
19531961 </para>
19541962 </listitem>
19551963 </varlistentry>
19561964 </variablelist>
19571965
19581966 <caution>
19591967 <para>
1960- If at all possible, do not use SIGKILL to shut down the
1961- postmaster. This can cause data corruption and will prevent the
1962- cleaning up of shared memory resources, which you will have to
1963- do yourself in that case.
1968+ It is best not to use SIGKILL to shut down the postmaster. This
1969+ will prevent the postmaster from releasing shared memory and
1970+ semaphores, which you may then have to do by hand.
19641971 </para>
19651972 </caution>
19661973
@@ -1969,12 +1976,13 @@ default:\
19691976 <filename>postmaster.pid</filename> in the data directory. So for
19701977 example, to do a fast shutdown:
19711978<screen>
1972- > <userinput>kill -INT `cat /usr/local/pgsql/data/postmaster.pid`</userinput>
1979+ > <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput>
19731980</screen>
19741981 </para>
19751982 <para>
19761983 The program <application>pg_ctl</application> is a shell script
1977- wrapper that provides a convenient interface to these functions.
1984+ that provides a more convenient interface for shutting down the
1985+ postmaster.
19781986 </para>
19791987 </sect1>
19801988
0 commit comments