Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
27b5a8ef
Commit
27b5a8ef
authored
Mar 24, 2001
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Miscellaneous updates and minor copy-editing.
parent
3311e250
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
32 deletions
+40
-32
doc/src/sgml/runtime.sgml
doc/src/sgml/runtime.sgml
+40
-32
No files found.
doc/src/sgml/runtime.sgml
View file @
27b5a8ef
<!--
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.5
7 2001/03/16 05:44:33
tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.5
8 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.
...
@@ -165,7 +165,7 @@ NOTICE: Initializing database with en_US collation order.
</para>
</para>
<para>
<para>
This shell
s
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
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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
...
@@ -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 postmas
e
ter, 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"
...
@@ -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
...
@@ -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:\
...
@@ -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:\
...
@@ -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:\
...
@@ -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:\
...
@@ -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:\
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment