Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0ca6ce

Browse files
author
Alexander Korotkov
committed
Readme.
1 parentcd0546f commitb0ca6ce

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

‎README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
pg\_wait\_sampling – sampling based statistics of wait events
2+
=============================================================
3+
4+
Introduction
5+
------------
6+
7+
PostgreSQL 9.6+ provides an information about current wait event of particular
8+
process. However, in order to gather descriptive statistics of server
9+
behavior user have to sample current wait event multiple times.
10+
pg\_wait\_sampling is an extension for collecting sampling statistics of wait
11+
events. It collects two kinds of statistics.
12+
13+
* History of waits events. It's implemented as in-memory ring buffer where
14+
samples of each process wait events are written with given (configurable)
15+
period. Therefore, for each running process user can see some number of
16+
recent samples depending on history size (configurable). Assuming there is
17+
a client who periodically read this history and dump it somewhere, user
18+
can have continuous history.
19+
* Waits profile. It's implemented as in-memory hash table where count
20+
of samples are accumulated per each process and each wait event. This hash
21+
table can be reset by user request. Assuming there is a client who
22+
periodically dumps profile and resets it, user can have statistics of
23+
intensivity of wait events among time.
24+
25+
pg\_wait\_sampling launches special background worker for gathering the
26+
statistics above.
27+
28+
Authors
29+
-------
30+
31+
* Alexander Korotkov <a.korotkov@postgrespro.ru>, Postgres Professional,
32+
Moscow, Russia
33+
34+
Availability
35+
------------
36+
37+
pg\_wait\_sampling is realized as an extension and not available in default
38+
PostgreSQL installation. It is available from
39+
[github](https://github.com/postgrespro/pg_wait_sampling)
40+
under the same license as
41+
[PostgreSQL](http://www.postgresql.org/about/licence/)
42+
and supports PostgreSQL 9.6+.
43+
44+
Installation
45+
------------
46+
47+
pg\_wait\_sampling is PostgreSQL extension which requires PostgreSQL 9.6 or
48+
higher. Before build and install you should ensure following:
49+
50+
* PostgreSQL version is 9.6 or higher.
51+
* You have development package of PostgreSQL installed or you built
52+
PostgreSQL from source.
53+
* Your PATH variable is configured so that pg\_config command available, or
54+
set PG_CONFIG variable.
55+
56+
Typical installation procedure may look like this:
57+
58+
$ git clone https://github.com/postgrespro/pg_wait_sampling.git
59+
$ cd pg_wait_sampling
60+
$ make USE_PGXS=1
61+
$ sudo make USE_PGXS=1 install
62+
$ make USE_PGXS=1 installcheck
63+
$ psql DB -c "CREATE EXTENSION pg_wait_sampling;"
64+
65+
Usage
66+
-----
67+
68+
pg\_wait\_sampling interacts with user by set of views and functions.
69+
70+
pg\_wait\_sampling\_current view -- information about current wait events for
71+
all processed including background workers.
72+
73+
| Column name| Column type| Description|
74+
| -----------| -----------| -----------------------|
75+
| pid| int4| Id of process|
76+
| event_type| text| Name of wait event type|
77+
| event| text| Name of wait event|
78+
79+
pg_wait_sampling_get_current(pid int4) returns the same table for single given
80+
process.
81+
82+
pg\_wait\_sampling\_history -- history of wait events obtained by sampling into
83+
in-memory ring buffer.
84+
85+
| Column name| Column type| Description|
86+
| -----------| -----------| -----------------------|
87+
| pid| int4| Id of process|
88+
| ts| timestamptz| Sample timestamp|
89+
| event_type| text| Name of wait event type|
90+
| event| text| Name of wait event|
91+
92+
pg\_wait\_sampling\_profile -- profile of wait events obtained by sampling into
93+
in-memory hash table.
94+
95+
| Column name| Column type| Description|
96+
| -----------| -----------| -----------------------|
97+
| pid| int4| Id of process|
98+
| event_type| text| Name of wait event type|
99+
| event| text| Name of wait event|
100+
| count| text| Count of samples|
101+
102+
pg_wait_sampling_reset_profile() function resets the profile.
103+
104+
Contribution
105+
------------
106+
107+
Please, notice, that pg\_wait\_sampling is still under development and while
108+
it's stable and tested, it may contains some bugs. Don't hesitate to raise
109+
[issues at github](https://github.com/postgrespro/pg_wait_sampling/issues) with
110+
your bug reports.
111+
112+
If you're lacking of some functionality in pg\_wait\_sampling and feeling power
113+
to implement it then you're welcome to make pull requests.
114+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp