~ubuntu-branches/ubuntu/precise/postgresql-9.1/precise-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/html/monitoring-ps.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Standard Unix Tools</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REV="MADE"
 
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
 
11
REL="HOME"
 
12
TITLE="PostgreSQL 9.1beta1 Documentation"
 
13
HREF="index.html"><LINK
 
14
REL="UP"
 
15
TITLE="Monitoring Database Activity"
 
16
HREF="monitoring.html"><LINK
 
17
REL="PREVIOUS"
 
18
TITLE="Monitoring Database Activity"
 
19
HREF="monitoring.html"><LINK
 
20
REL="NEXT"
 
21
TITLE="The Statistics Collector"
 
22
HREF="monitoring-stats.html"><LINK
 
23
REL="STYLESHEET"
 
24
TYPE="text/css"
 
25
HREF="stylesheet.css"><META
 
26
HTTP-EQUIV="Content-Type"
 
27
CONTENT="text/html; charset=ISO-8859-1"><META
 
28
NAME="creation"
 
29
CONTENT="2011-04-27T21:20:33"></HEAD
 
30
><BODY
 
31
CLASS="SECT1"
 
32
><DIV
 
33
CLASS="NAVHEADER"
 
34
><TABLE
 
35
SUMMARY="Header navigation table"
 
36
WIDTH="100%"
 
37
BORDER="0"
 
38
CELLPADDING="0"
 
39
CELLSPACING="0"
 
40
><TR
 
41
><TH
 
42
COLSPAN="5"
 
43
ALIGN="center"
 
44
VALIGN="bottom"
 
45
><A
 
46
HREF="index.html"
 
47
>PostgreSQL 9.1beta1 Documentation</A
 
48
></TH
 
49
></TR
 
50
><TR
 
51
><TD
 
52
WIDTH="10%"
 
53
ALIGN="left"
 
54
VALIGN="top"
 
55
><A
 
56
TITLE="Monitoring Database Activity"
 
57
HREF="monitoring.html"
 
58
ACCESSKEY="P"
 
59
>Prev</A
 
60
></TD
 
61
><TD
 
62
WIDTH="10%"
 
63
ALIGN="left"
 
64
VALIGN="top"
 
65
><A
 
66
TITLE="Monitoring Database Activity"
 
67
HREF="monitoring.html"
 
68
>Fast Backward</A
 
69
></TD
 
70
><TD
 
71
WIDTH="60%"
 
72
ALIGN="center"
 
73
VALIGN="bottom"
 
74
>Chapter 27. Monitoring Database Activity</TD
 
75
><TD
 
76
WIDTH="10%"
 
77
ALIGN="right"
 
78
VALIGN="top"
 
79
><A
 
80
TITLE="Monitoring Database Activity"
 
81
HREF="monitoring.html"
 
82
>Fast Forward</A
 
83
></TD
 
84
><TD
 
85
WIDTH="10%"
 
86
ALIGN="right"
 
87
VALIGN="top"
 
88
><A
 
89
TITLE="The Statistics Collector"
 
90
HREF="monitoring-stats.html"
 
91
ACCESSKEY="N"
 
92
>Next</A
 
93
></TD
 
94
></TR
 
95
></TABLE
 
96
><HR
 
97
ALIGN="LEFT"
 
98
WIDTH="100%"></DIV
 
99
><DIV
 
100
CLASS="SECT1"
 
101
><H1
 
102
CLASS="SECT1"
 
103
><A
 
104
NAME="MONITORING-PS"
 
105
>27.1. Standard Unix Tools</A
 
106
></H1
 
107
><P
 
108
>   On most Unix platforms, <SPAN
 
109
CLASS="PRODUCTNAME"
 
110
>PostgreSQL</SPAN
 
111
> modifies its
 
112
   command title as reported by <TT
 
113
CLASS="COMMAND"
 
114
>ps</TT
 
115
>, so that individual server
 
116
   processes can readily be identified.  A sample display is
 
117
 
 
118
</P><PRE
 
119
CLASS="SCREEN"
 
120
>$ ps auxww | grep ^postgres
 
121
postgres   960  0.0  1.1  6104 1480 pts/1    SN   13:17   0:00 postgres -i
 
122
postgres   963  0.0  1.1  7084 1472 pts/1    SN   13:17   0:00 postgres: writer process
 
123
postgres   965  0.0  1.1  6152 1512 pts/1    SN   13:17   0:00 postgres: stats collector process
 
124
postgres   998  0.0  2.3  6532 2992 pts/1    SN   13:18   0:00 postgres: tgl runbug 127.0.0.1 idle
 
125
postgres  1003  0.0  2.4  6532 3128 pts/1    SN   13:19   0:00 postgres: tgl regression [local] SELECT waiting
 
126
postgres  1016  0.1  2.4  6532 3080 pts/1    SN   13:19   0:00 postgres: tgl regression [local] idle in transaction</PRE
 
127
><P>
 
128
 
 
129
   (The appropriate invocation of <TT
 
130
CLASS="COMMAND"
 
131
>ps</TT
 
132
> varies across different
 
133
   platforms, as do the details of what is shown.  This example is from a
 
134
   recent Linux system.)  The first process listed here is the
 
135
   master server process.  The command arguments
 
136
   shown for it are the same ones used when it was launched.  The next two
 
137
   processes are background worker processes automatically launched by the
 
138
   master process.  (The <SPAN
 
139
CLASS="QUOTE"
 
140
>"stats collector"</SPAN
 
141
> process will not be present
 
142
   if you have set
 
143
   the system not to start the statistics collector.)  Each of the remaining
 
144
   processes is a server process handling one client connection.  Each such
 
145
   process sets its command line display in the form
 
146
 
 
147
</P><PRE
 
148
CLASS="SCREEN"
 
149
>postgres: <TT
 
150
CLASS="REPLACEABLE"
 
151
><I
 
152
>user</I
 
153
></TT
 
154
> <TT
 
155
CLASS="REPLACEABLE"
 
156
><I
 
157
>database</I
 
158
></TT
 
159
> <TT
 
160
CLASS="REPLACEABLE"
 
161
><I
 
162
>host</I
 
163
></TT
 
164
> <TT
 
165
CLASS="REPLACEABLE"
 
166
><I
 
167
>activity</I
 
168
></TT
 
169
></PRE
 
170
><P>
 
171
 
 
172
  The user, database, and (client) host items remain the same for
 
173
  the life of the client connection, but the activity indicator changes.
 
174
  The activity can be <TT
 
175
CLASS="LITERAL"
 
176
>idle</TT
 
177
> (i.e., waiting for a client command),
 
178
  <TT
 
179
CLASS="LITERAL"
 
180
>idle in transaction</TT
 
181
> (waiting for client inside a <TT
 
182
CLASS="COMMAND"
 
183
>BEGIN</TT
 
184
> block),
 
185
  or a command type name such as <TT
 
186
CLASS="LITERAL"
 
187
>SELECT</TT
 
188
>.  Also,
 
189
  <TT
 
190
CLASS="LITERAL"
 
191
>waiting</TT
 
192
> is appended if the server process is presently waiting
 
193
  on a lock held by another session.  In the above example we can infer
 
194
  that process 1003 is waiting for process 1016 to complete its transaction and
 
195
  thereby release some lock.
 
196
  </P
 
197
><P
 
198
>   If you have turned off <A
 
199
HREF="runtime-config-statistics.html#GUC-UPDATE-PROCESS-TITLE"
 
200
>update_process_title</A
 
201
> then the
 
202
   activity indicator is not updated; the process title is set only once
 
203
   when a new process is launched.  On some platforms this saves a measurable
 
204
   amount of per-command overhead;  on others it's insignificant.
 
205
  </P
 
206
><DIV
 
207
CLASS="TIP"
 
208
><BLOCKQUOTE
 
209
CLASS="TIP"
 
210
><P
 
211
><B
 
212
>Tip: </B
 
213
>  <SPAN
 
214
CLASS="PRODUCTNAME"
 
215
>Solaris</SPAN
 
216
> requires special handling. You must
 
217
  use <TT
 
218
CLASS="COMMAND"
 
219
>/usr/ucb/ps</TT
 
220
>, rather than
 
221
  <TT
 
222
CLASS="COMMAND"
 
223
>/bin/ps</TT
 
224
>. You also must use two <TT
 
225
CLASS="OPTION"
 
226
>w</TT
 
227
>
 
228
  flags, not just one. In addition, your original invocation of the
 
229
  <TT
 
230
CLASS="COMMAND"
 
231
>postgres</TT
 
232
> command must have a shorter
 
233
  <TT
 
234
CLASS="COMMAND"
 
235
>ps</TT
 
236
> status display than that provided by each
 
237
  server process.  If you fail to do all three things, the <TT
 
238
CLASS="COMMAND"
 
239
>ps</TT
 
240
>
 
241
  output for each server process will be the original <TT
 
242
CLASS="COMMAND"
 
243
>postgres</TT
 
244
>
 
245
  command line.
 
246
  </P
 
247
></BLOCKQUOTE
 
248
></DIV
 
249
></DIV
 
250
><DIV
 
251
CLASS="NAVFOOTER"
 
252
><HR
 
253
ALIGN="LEFT"
 
254
WIDTH="100%"><TABLE
 
255
SUMMARY="Footer navigation table"
 
256
WIDTH="100%"
 
257
BORDER="0"
 
258
CELLPADDING="0"
 
259
CELLSPACING="0"
 
260
><TR
 
261
><TD
 
262
WIDTH="33%"
 
263
ALIGN="left"
 
264
VALIGN="top"
 
265
><A
 
266
HREF="monitoring.html"
 
267
ACCESSKEY="P"
 
268
>Prev</A
 
269
></TD
 
270
><TD
 
271
WIDTH="34%"
 
272
ALIGN="center"
 
273
VALIGN="top"
 
274
><A
 
275
HREF="index.html"
 
276
ACCESSKEY="H"
 
277
>Home</A
 
278
></TD
 
279
><TD
 
280
WIDTH="33%"
 
281
ALIGN="right"
 
282
VALIGN="top"
 
283
><A
 
284
HREF="monitoring-stats.html"
 
285
ACCESSKEY="N"
 
286
>Next</A
 
287
></TD
 
288
></TR
 
289
><TR
 
290
><TD
 
291
WIDTH="33%"
 
292
ALIGN="left"
 
293
VALIGN="top"
 
294
>Monitoring Database Activity</TD
 
295
><TD
 
296
WIDTH="34%"
 
297
ALIGN="center"
 
298
VALIGN="top"
 
299
><A
 
300
HREF="monitoring.html"
 
301
ACCESSKEY="U"
 
302
>Up</A
 
303
></TD
 
304
><TD
 
305
WIDTH="33%"
 
306
ALIGN="right"
 
307
VALIGN="top"
 
308
>The Statistics Collector</TD
 
309
></TR
 
310
></TABLE
 
311
></DIV
 
312
></BODY
 
313
></HTML
 
314
>
 
 
b'\\ No newline at end of file'