diff options
author | Andres Freund <andres@anarazel.de> | 2014-06-29 14:15:09 +0200 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2014-06-29 14:15:09 +0200 |
commit | 51adcaa0df81da5e94b582d47de64ebb17129937 (patch) | |
tree | 07bec85843d91c69bfbd554a586c8d5d85b2aff8 /doc/src | |
parent | a6d488cb538c8761658f0f7edfc40cecc8c29f2d (diff) | |
download | postgresql-51adcaa0df81da5e94b582d47de64ebb17129937.tar.gz postgresql-51adcaa0df81da5e94b582d47de64ebb17129937.zip |
Add cluster_name GUC which is included in process titles if set.
When running several postgres clusters on one OS instance it's often
inconveniently hard to identify which "postgres" process belongs to
which postgres instance.
Add the cluster_name GUC, whose value will be included as part of the
process titles if set. With that processes can more easily identified
using tools like 'ps'.
To avoid problems with encoding mismatches between postgresql.conf,
consoles, and individual databases replace non-ASCII chars in the name
with question marks. The length is limited to NAMEDATALEN to make it
less likely to truncate important information at the end of the
status.
Thomas Munro, with some adjustments by me and review by a host of people.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/config.sgml | 23 | ||||
-rw-r--r-- | doc/src/sgml/monitoring.sgml | 16 |
2 files changed, 39 insertions, 0 deletions
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index e3d1c622122..11d552e82d8 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -4131,6 +4131,29 @@ local0.* /var/log/postgresql </listitem> </varlistentry> + <varlistentry id="guc-cluster-name" xreflabel="cluster_name"> + <term><varname>cluster_name</varname> (<type>string</type>)</term> + <indexterm> + <primary><varname>cluster_name</> configuration parameter</primary> + </indexterm> + <listitem> + <para> + Sets the cluster name that appears in the process title for all + processes in this cluster. The name can be any string of less than + <symbol>NAMEDATALEN</> characters (64 characters in a standard + build). Only printable ASCII characters may be used in the + <varname>application_name</varname> value. Other characters will be + replaced with question marks (<literal>?</literal>). No name is shown + if this parameter is set to the empty string <literal>''</> (which is + the default). This parameter can only be set at server start. + </para> + <para> + The process title is typically viewed using programs like + <application>ps</> or, on Windows, <application>Process Explorer</>. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><varname>debug_print_parse</varname> (<type>boolean</type>) <indexterm> diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 69d99e7c75f..cef3fc0dc4e 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -92,6 +92,22 @@ postgres: <replaceable>user</> <replaceable>database</> <replaceable>host</> <re </para> <para> + If <xref linkend="guc-cluster-name"> has been configured the + cluster name will also be show in <command>ps</> output: +<screen> +$ psql -c 'SHOW cluster_name' + cluster_name +-------------- + server1 +(1 row) + +$ ps aux|grep server1 +postgres 27093 0.0 0.0 30096 2752 ? Ss 11:34 0:00 postgres: server1: writer process +... +</screen> + </para> + + <para> If you have turned off <xref linkend="guc-update-process-title"> then the activity indicator is not updated; the process title is set only once when a new process is launched. On some platforms this saves a measurable |