- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit28e626b
committed
pgstat: Infrastructure for more detailed IO statistics
This commit adds the infrastructure for more detailed IO statistics. The callsto actually count IOs, a system view to access the new statistics,documentation and tests will be added in subsequent commits, to make revieweasier.While we already had some IO statistics, e.g. in pg_stat_bgwriter andpg_stat_database, they did not provide sufficient detail to understand whatthe main sources of IO are, or whether configuration changes could avoidIO. E.g., pg_stat_bgwriter.buffers_backend does contain the number of bufferswritten out by a backend, but as that includes extending relations (alwaysdone by backends) and writes triggered by the use of buffer access strategies,it cannot easily be used to tune background writer or checkpointer. Similarly,pg_stat_database.blks_read cannot easily be used to tune shared_buffers /compute a cache hit ratio, as the use of buffer access strategies will oftenprevent a large fraction of the read blocks to end up in shared_buffers.The new IO statistics count IO operations (evict, extend, fsync, read, reuse,and write), and are aggregated for each combination of backend type (backend,autovacuum worker, bgwriter, etc), target object of the IO (relations, temprelations) and context of the IO (normal, vacuum, bulkread, bulkwrite).What is tracked in this series of patches, is sufficient to perform theaforementioned analyses. Further details, e.g. tracking the number of bufferhits, would make that even easier, but was left out for now, to keep the scopeof the already large patchset manageable.Bumps PGSTAT_FILE_FORMAT_ID.Author: Melanie Plageman <melanieplageman@gmail.com>Reviewed-by: Andres Freund <andres@anarazel.de>Reviewed-by: Justin Pryzby <pryzby@telsasoft.com>Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://postgr.es/m/20200124195226.lth52iydq2n2uilq@alap3.anarazel.de1 parent49c2c5f commit28e626b
File tree
15 files changed
+569
-8
lines changed- doc/src/sgml
- src
- backend/utils
- activity
- adt
- include
- utils
- tools/pgindent
15 files changed
+569
-8
lines changedLines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5444 | 5444 |
| |
5445 | 5445 |
| |
5446 | 5446 |
| |
| 5447 | + | |
| 5448 | + | |
5447 | 5449 |
| |
5448 | 5450 |
| |
5449 | 5451 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
| 25 | + | |
25 | 26 |
| |
26 | 27 |
| |
27 | 28 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
| 12 | + | |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| 75 | + | |
75 | 76 |
| |
76 | 77 |
| |
77 | 78 |
| |
| |||
359 | 360 |
| |
360 | 361 |
| |
361 | 362 |
| |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
362 | 372 |
| |
363 | 373 |
| |
364 | 374 |
| |
| |||
582 | 592 |
| |
583 | 593 |
| |
584 | 594 |
| |
| 595 | + | |
585 | 596 |
| |
586 | 597 |
| |
587 | 598 |
| |
| |||
628 | 639 |
| |
629 | 640 |
| |
630 | 641 |
| |
| 642 | + | |
| 643 | + | |
| 644 | + | |
631 | 645 |
| |
632 | 646 |
| |
633 | 647 |
| |
| |||
1322 | 1336 |
| |
1323 | 1337 |
| |
1324 | 1338 |
| |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
1325 | 1345 |
| |
1326 | 1346 |
| |
1327 | 1347 |
| |
| |||
1496 | 1516 |
| |
1497 | 1517 |
| |
1498 | 1518 |
| |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1499 | 1525 |
| |
1500 | 1526 |
| |
1501 | 1527 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
| 27 | + | |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| |||
56 | 56 |
| |
57 | 57 |
| |
58 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
59 | 64 |
| |
60 | 65 |
| |
61 | 66 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
| 27 | + | |
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 |
| |
66 | 71 |
| |
67 | 72 |
| |
|
0 commit comments
Comments
(0)