- Notifications
You must be signed in to change notification settings - Fork5k
Commit5891c7a
committed
pgstat: store statistics in shared memory.
Previously the statistics collector received statistics updates via UDP andshared statistics data by writing them out to temporary files regularly. Thesefiles can reach tens of megabytes and are written out up to twice asecond. This has repeatedly prevented us from adding additional usefulstatistics.Now statistics are stored in shared memory. Statistics for variable-numberedobjects are stored in a dshash hashtable (backed by dynamic sharedmemory). Fixed-numbered stats are stored in plain shared memory.The header for pgstat.c contains an overview of the architecture.The stats collector is not needed anymore, remove it.By utilizing the transactional statistics drop infrastructure introduced in aprior commit statistics entries cannot "leak" anymore. Previously leakedstatistics were dropped by pgstat_vacuum_stat(), called from [auto-]vacuum. Onsystems with many small relations pgstat_vacuum_stat() could be quiteexpensive.Now that replicas drop statistics entries for dropped objects, it is notnecessary anymore to reset stats when starting from a cleanly shut downreplica.Subsequent commits will perform some further code cleanup, adapt docs and addtests.Bumps PGSTAT_FILE_FORMAT_ID.Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Author: Andres Freund <andres@anarazel.de>Author: Melanie Plageman <melanieplageman@gmail.com>Reviewed-By: Andres Freund <andres@anarazel.de>Reviewed-By: Thomas Munro <thomas.munro@gmail.com>Reviewed-By: Justin Pryzby <pryzby@telsasoft.com>Reviewed-By: "David G. Johnston" <david.g.johnston@gmail.com>Reviewed-By: Tomas Vondra <tomas.vondra@2ndquadrant.com> (in a much earlier version)Reviewed-By: Arthur Zakirov <a.zakirov@postgrespro.ru> (in a much earlier version)Reviewed-By: Antonin Houska <ah@cybertec.at> (in a much earlier version)Discussion:https://postgr.es/m/20220303021600.hs34ghqcw6zcokdh@alap3.anarazel.deDiscussion:https://postgr.es/m/20220308205351.2xcn6k4x5yivcxyd@alap3.anarazel.deDiscussion:https://postgr.es/m/20210319235115.y3wz7hpnnrshdyv6@alap3.anarazel.de1 parentbe902e2 commit5891c7a
File tree
50 files changed
+4253
-5343
lines changed- doc/src/sgml
- src
- backend
- access/transam
- commands
- postmaster
- replication
- logical
- storage
- buffer
- ipc
- lmgr
- tcop
- utils
- activity
- adt
- cache
- init
- misc
- include
- storage
- utils
- test
- modules/worker_spi
- regress
- expected
- sql
- tools
- pgindent
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+4253
-5343
lines changedLines changed: 14 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1110 | 1110 |
| |
1111 | 1111 |
| |
1112 | 1112 |
| |
1113 |
| - | |
1114 |
| - | |
1115 |
| - | |
1116 |
| - | |
1117 | 1113 |
| |
1118 | 1114 |
| |
1119 | 1115 |
| |
| |||
2115 | 2111 |
| |
2116 | 2112 |
| |
2117 | 2113 |
| |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
2118 | 2126 |
| |
2119 | 2127 |
| |
2120 | 2128 |
| |
| |||
5142 | 5150 |
| |
5143 | 5151 |
| |
5144 | 5152 |
| |
5145 |
| - | |
| 5153 | + | |
| 5154 | + | |
5146 | 5155 |
| |
5147 | 5156 |
| |
5148 | 5157 |
| |
|
Lines changed: 27 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1842 | 1842 |
| |
1843 | 1843 |
| |
1844 | 1844 |
| |
1845 |
| - | |
| 1845 | + | |
1846 | 1846 |
| |
1847 | 1847 |
| |
1848 | 1848 |
| |
| |||
2200 | 2200 |
| |
2201 | 2201 |
| |
2202 | 2202 |
| |
2203 |
| - | |
| 2203 | + | |
2204 | 2204 |
| |
2205 | 2205 |
| |
2206 |
| - | |
| 2206 | + | |
2207 | 2207 |
| |
2208 | 2208 |
| |
2209 | 2209 |
| |
| |||
4877 | 4877 |
| |
4878 | 4878 |
| |
4879 | 4879 |
| |
| 4880 | + | |
4880 | 4881 |
| |
4881 | 4882 |
| |
4882 | 4883 |
| |
| |||
4994 | 4995 |
| |
4995 | 4996 |
| |
4996 | 4997 |
| |
| 4998 | + | |
4997 | 4999 |
| |
| 5000 | + | |
| 5001 | + | |
4998 | 5002 |
| |
4999 | 5003 |
| |
5000 | 5004 |
| |
| |||
5106 | 5110 |
| |
5107 | 5111 |
| |
5108 | 5112 |
| |
| 5113 | + | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
| 5117 | + | |
| 5118 | + | |
| 5119 | + | |
| 5120 | + | |
| 5121 | + | |
| 5122 | + | |
| 5123 | + | |
| 5124 | + | |
| 5125 | + | |
| 5126 | + | |
| 5127 | + | |
| 5128 | + | |
5109 | 5129 |
| |
5110 | 5130 |
| |
5111 | 5131 |
| |
| |||
5180 | 5200 |
| |
5181 | 5201 |
| |
5182 | 5202 |
| |
5183 |
| - | |
5184 |
| - | |
5185 |
| - | |
5186 |
| - | |
5187 |
| - | |
5188 | 5203 |
| |
5189 | 5204 |
| |
5190 | 5205 |
| |
| |||
6081 | 6096 |
| |
6082 | 6097 |
| |
6083 | 6098 |
| |
6084 |
| - | |
6085 |
| - | |
| 6099 | + | |
| 6100 | + | |
6086 | 6101 |
| |
6087 | 6102 |
| |
6088 | 6103 |
| |
| |||
8009 | 8024 |
| |
8010 | 8025 |
| |
8011 | 8026 |
| |
8012 |
| - | |
| 8027 | + | |
8013 | 8028 |
| |
8014 | 8029 |
| |
8015 |
| - | |
| 8030 | + | |
8016 | 8031 |
| |
8017 | 8032 |
| |
8018 | 8033 |
| |
|
Lines changed: 0 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
351 | 351 |
| |
352 | 352 |
| |
353 | 353 |
| |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 |
| - | |
358 |
| - | |
359 |
| - | |
360 |
| - | |
361 | 354 |
| |
362 | 355 |
| |
363 | 356 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
31 | 32 |
| |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
37 | 38 |
| |
| 39 | + | |
38 | 40 |
| |
39 | 41 |
| |
40 | 42 |
| |
|
0 commit comments
Comments
(0)