postgresql/src/backend/postmaster
Tomas Vondra 28cac71bd3 Collect statistics about SLRU caches
There's a number of SLRU caches used to access important data like clog,
commit timestamps, multixact, asynchronous notifications, etc. Until now
we had no easy way to monitor these shared caches, compute hit ratios,
number of reads/writes etc.

This commit extends the statistics collector to track this information
for a predefined list of SLRUs, and also introduces a new system view
pg_stat_slru displaying the data.

The list of built-in SLRUs is fixed, but additional SLRUs may be defined
in extensions. Unfortunately, there's no suitable registry of SLRUs, so
this patch simply defines a fixed list of SLRUs with entries for the
built-in ones and one entry for all additional SLRUs. Extensions adding
their own SLRU are fairly rare, so this seems acceptable.

This patch only allows monitoring of SLRUs, not tuning. The SLRU sizes
are still fixed (hard-coded in the code) and it's not entirely clear
which of the SLRUs might need a GUC to tune size. In a way, allowing us
to determine that is one of the goals of this patch.

Bump catversion as the patch introduces new functions and system view.

Author: Tomas Vondra
Reviewed-by: Alvaro Herrera
Discussion: https://www.postgresql.org/message-id/flat/20200119143707.gyinppnigokesjok@development
2020-04-02 02:34:21 +02:00
..
autovacuum.c Trigger autovacuum based on number of INSERTs 2020-03-28 19:20:12 +13:00
bgworker.c Unify several ways to tracking backend type 2020-03-13 14:01:10 +01:00
bgwriter.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
checkpointer.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
fork_process.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
interrupt.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00
Makefile Partially deduplicate interrupt handling for background processes. 2019-12-17 13:14:28 -05:00
pgarch.c Unify several ways to tracking backend type 2020-03-13 14:01:10 +01:00
pgstat.c Collect statistics about SLRU caches 2020-04-02 02:34:21 +02:00
postmaster.c Provide a TLS init hook 2020-03-25 17:13:17 -04:00
startup.c Allow walreceiver configuration to change on reload 2020-03-27 19:51:37 -03:00
syslogger.c Remove am_syslogger global variable 2020-03-13 14:01:15 +01:00
walwriter.c Update copyrights for 2020 2020-01-01 12:21:45 -05:00