mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Miscellaneous updates and minor copy-editing.
This commit is contained in:
parent
3311e250cd
commit
27b5a8ef0f
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.57 2001/03/16 05:44:33 tgl Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.58 2001/03/24 00:24:26 tgl Exp $
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<Chapter Id="runtime">
|
<Chapter Id="runtime">
|
||||||
@ -165,7 +165,7 @@ NOTICE: Initializing database with en_US collation order.
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
This shells syntax can get tedious quickly. Therefore the shell
|
This shell syntax can get tedious quickly. Therefore the shell
|
||||||
script wrapper <application>pg_ctl</application> is provided that
|
script wrapper <application>pg_ctl</application> is provided that
|
||||||
encapsulates some of the tasks. E.g.,
|
encapsulates some of the tasks. E.g.,
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@ -266,10 +266,10 @@ su - postgres -c "/usr/local/pgsql/bin/pg_ctl start -l logfile -D /usr/local/pgs
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
While the <application>postmaster</application> is running, it's
|
While the <application>postmaster</application> is running, its
|
||||||
PID is in the file <filename>postmaster.pid</filename> in the data
|
PID is in the file <filename>postmaster.pid</filename> in the data
|
||||||
directory. This is used as in interlock against multiple running
|
directory. This is used as an interlock against multiple postmasters
|
||||||
postmaster on the same data directory and can also be used for
|
running in the same data directory, and can also be used for
|
||||||
shutting down the postmaster.
|
shutting down the postmaster.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -364,8 +364,9 @@ IpcSemaphoreCreate: semget(key=5440026, num=16, 01600) failed: No space left on
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
<screen>
|
<screen>
|
||||||
connectDB() -- connect() failed: Connection refused
|
PQconnectPoll() -- connect() failed: Connection refused
|
||||||
Is the postmaster running (with -i) at 'server.joe.com' and accepting connections on TCP/IP port 5432?
|
Is the postmaster running (with -i) at 'server.joe.com'
|
||||||
|
and accepting connections on TCP/IP port 5432?
|
||||||
</screen>
|
</screen>
|
||||||
This is the generic <quote>I couldn't find a server to talk
|
This is the generic <quote>I couldn't find a server to talk
|
||||||
to</quote> failure. It looks like the above when TCP/IP
|
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
|
|||||||
Alternatively, you'll get this when attempting
|
Alternatively, you'll get this when attempting
|
||||||
Unix-socket communication to a local postmaster:
|
Unix-socket communication to a local postmaster:
|
||||||
<screen>
|
<screen>
|
||||||
connectDB() -- connect() failed: No such file or directory
|
connectDBstart() -- connect() failed: No such file or directory
|
||||||
Is the postmaster running locally and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
|
Is the postmaster running locally
|
||||||
|
and accepting connections on Unix socket '/tmp/.s.PGSQL.5432'?
|
||||||
</screen>
|
</screen>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
@ -454,6 +456,8 @@ syslog = 2
|
|||||||
postmaster -c log_connections=yes -c syslog=2
|
postmaster -c log_connections=yes -c syslog=2
|
||||||
</programlisting>
|
</programlisting>
|
||||||
which would have the same effect as the previous example.
|
which would have the same effect as the previous example.
|
||||||
|
Command-line options override any conflicting settings in
|
||||||
|
<filename>postgresql.conf</filename>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -1066,7 +1070,9 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
that for a complex query, several sorts and/or hashes might be
|
that for a complex query, several sorts and/or hashes might be
|
||||||
running in parallel, and each one will be allowed to use as
|
running in parallel, and each one will be allowed to use as
|
||||||
much memory as this value specifies before it starts to put
|
much memory as this value specifies before it starts to put
|
||||||
data into temporary files.
|
data into temporary files. And don't forget that each running
|
||||||
|
backend could be doing one or more sorts. So the total memory
|
||||||
|
space needed could be many times the value of SORT_MEM.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -1396,7 +1402,7 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
not relevant for <productname>Postgres</>). Almost all modern
|
not relevant for <productname>Postgres</>). Almost all modern
|
||||||
operating systems provide these features, but not all of them have
|
operating systems provide these features, but not all of them have
|
||||||
them turned on or sufficiently sized by default, especially
|
them turned on or sufficiently sized by default, especially
|
||||||
systems with BSD heritage. (For the QNX port,
|
systems with BSD heritage. (For the QNX and BeOS ports,
|
||||||
<productname>Postgres</> provides its own replacement
|
<productname>Postgres</> provides its own replacement
|
||||||
implementation of these facilities.)
|
implementation of these facilities.)
|
||||||
</para>
|
</para>
|
||||||
@ -1510,7 +1516,7 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
estimate the required segment size as the number of buffers times
|
estimate the required segment size as the number of buffers times
|
||||||
the block size (8192 kB by default) plus ample overhead (at least
|
the block size (8192 kB by default) plus ample overhead (at least
|
||||||
half a megabyte). Any error message you might get will contain the
|
half a megabyte). Any error message you might get will contain the
|
||||||
size of the failed allocation.
|
size of the failed allocation request.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -1533,7 +1539,7 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
is set by <varname>SEMMNS</>, which consequently must be at least
|
is set by <varname>SEMMNS</>, which consequently must be at least
|
||||||
as high as the connection setting plus one extra for each 16
|
as high as the connection setting plus one extra for each 16
|
||||||
allowed connections (see the formula in <xref
|
allowed connections (see the formula in <xref
|
||||||
linkend="sysvipc-parameters">. The parameter <varname>SEMMNI</>
|
linkend="sysvipc-parameters">). The parameter <varname>SEMMNI</>
|
||||||
determines the limit on the number of semaphore sets that can
|
determines the limit on the number of semaphore sets that can
|
||||||
exist on the system at one time. Hence this parameter must be at
|
exist on the system at one time. Hence this parameter must be at
|
||||||
least <literal>ceil(max_connections / 16)</>. Lowering the number
|
least <literal>ceil(max_connections / 16)</>. Lowering the number
|
||||||
@ -1588,7 +1594,7 @@ env PGOPTIONS='-c geqo=off' psql
|
|||||||
#define SHMALL /* max amount of shared memory (pages) */
|
#define SHMALL /* max amount of shared memory (pages) */
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
To increase the number of buffers supported by the postmaseter, add the
|
To increase the number of buffers supported by the postmaster, add the
|
||||||
following to your kernel config file. A <varname>SHMALL</> value of 1024
|
following to your kernel config file. A <varname>SHMALL</> value of 1024
|
||||||
represents 4MB of shared memory. Increase it accordingly:
|
represents 4MB of shared memory. Increase it accordingly:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@ -1621,9 +1627,8 @@ options "SYSPTSIZE=13"
|
|||||||
<title>Semaphores</>
|
<title>Semaphores</>
|
||||||
<para>
|
<para>
|
||||||
You may need to increase the number of semaphores. By
|
You may need to increase the number of semaphores. By
|
||||||
default, <productname>Postgres</> allocates 32 semaphores,
|
default, <productname>Postgres</> allocates 34 semaphores,
|
||||||
one for each backend connection. This is just over half the
|
which is over half the default system total of 60.
|
||||||
default system total of 60.
|
|
||||||
</para>
|
</para>
|
||||||
</formalpara>
|
</formalpara>
|
||||||
|
|
||||||
@ -1845,7 +1850,7 @@ set semsys:seminfo_semmsl=32
|
|||||||
counts but it can be changed by the user up to the hard limit.
|
counts but it can be changed by the user up to the hard limit.
|
||||||
The hard limit can only be changed by the root user. The system
|
The hard limit can only be changed by the root user. The system
|
||||||
call <function>setrlimit</function> is responsible for setting
|
call <function>setrlimit</function> is responsible for setting
|
||||||
these parameters. The shell the built-in command
|
these parameters. The shell's built-in command
|
||||||
<command>ulimit</command> (Bourne shells) or
|
<command>ulimit</command> (Bourne shells) or
|
||||||
<command>limit</command> (csh) is used to control the resource
|
<command>limit</command> (csh) is used to control the resource
|
||||||
limits from the command line. On BSD-derived systems the file
|
limits from the command line. On BSD-derived systems the file
|
||||||
@ -1922,8 +1927,9 @@ default:\
|
|||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
After receiving SIGTERM, the postmaster disallows new
|
After receiving SIGTERM, the postmaster disallows new
|
||||||
connections but lets active backend end their work and shuts
|
connections, but lets existing backends end their work normally.
|
||||||
down only after all of them terminated (by client request).
|
It shuts down only after all of the backends terminate by client
|
||||||
|
request.
|
||||||
This is the <firstterm>Smart Shutdown</firstterm>.
|
This is the <firstterm>Smart Shutdown</firstterm>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -1933,10 +1939,11 @@ default:\
|
|||||||
<term>SIGINT</term>
|
<term>SIGINT</term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The postmaster disallows new connections, sends all active
|
The postmaster disallows new connections and sends all existing
|
||||||
backends SIGTERM (which will cause them to abort immediately),
|
backends SIGTERM, which will cause them to abort their current
|
||||||
waits for children to exit and shuts down the data base. This
|
transactions and exit promptly. It then waits for the backends to exit
|
||||||
is the <firstterm>Fast Shutdown</firstterm>.
|
and finally shuts down the data base.
|
||||||
|
This is the <firstterm>Fast Shutdown</firstterm>.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -1948,8 +1955,9 @@ default:\
|
|||||||
This is the <firstterm>Immediate Shutdown</firstterm> which
|
This is the <firstterm>Immediate Shutdown</firstterm> which
|
||||||
will cause the postmaster to send a SIGQUIT to all backends and
|
will cause the postmaster to send a SIGQUIT to all backends and
|
||||||
exit immediately (without properly shutting down the database
|
exit immediately (without properly shutting down the database
|
||||||
system). When WAL is implemented, this will lead to recovery on
|
system). The backends likewise exit immediately upon receiving
|
||||||
start-up. Right now it's not recommendable to use this option.
|
SIGQUIT. This will lead to recovery (by replaying the WAL log)
|
||||||
|
upon next start-up. This is recommended only in emergencies.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
@ -1957,10 +1965,9 @@ default:\
|
|||||||
|
|
||||||
<caution>
|
<caution>
|
||||||
<para>
|
<para>
|
||||||
If at all possible, do not use SIGKILL to shut down the
|
It is best not to use SIGKILL to shut down the postmaster. This
|
||||||
postmaster. This can cause data corruption and will prevent the
|
will prevent the postmaster from releasing shared memory and
|
||||||
cleaning up of shared memory resources, which you will have to
|
semaphores, which you may then have to do by hand.
|
||||||
do yourself in that case.
|
|
||||||
</para>
|
</para>
|
||||||
</caution>
|
</caution>
|
||||||
|
|
||||||
@ -1969,12 +1976,13 @@ default:\
|
|||||||
<filename>postmaster.pid</filename> in the data directory. So for
|
<filename>postmaster.pid</filename> in the data directory. So for
|
||||||
example, to do a fast shutdown:
|
example, to do a fast shutdown:
|
||||||
<screen>
|
<screen>
|
||||||
> <userinput>kill -INT `cat /usr/local/pgsql/data/postmaster.pid`</userinput>
|
> <userinput>kill -INT `head -1 /usr/local/pgsql/data/postmaster.pid`</userinput>
|
||||||
</screen>
|
</screen>
|
||||||
</para>
|
</para>
|
||||||
<para>
|
<para>
|
||||||
The program <application>pg_ctl</application> is a shell script
|
The program <application>pg_ctl</application> is a shell script
|
||||||
wrapper that provides a convenient interface to these functions.
|
that provides a more convenient interface for shutting down the
|
||||||
|
postmaster.
|
||||||
</para>
|
</para>
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user