PG监控方法总结
Tags: PGPostgreSQL总结
- 简介
- 常见监控软件
- Statistics collector
- contrib extensions
- pg_stat_statements
- pg_stat_plans
- pgstattuple
- pg_buffercache
- External projects
- CLI tools
- pg_view
- pg_activity
- pgmetrics
- pgstats
- pgcenter
- Checkers
- check_pgactivity
- check_postgres
- Interfaces & collectors
- pgsnmpd
- pganalyze/collector
- pgexporter
- prometheus/postgres_exporter
- weaponry/pgSCV
- Generic monitoring solutions with plugins
- Zabbix
- Munin
- NewRelic
- Datadog
- Circonus
- ClusterControl by Severalnines
- Cacti
- Okmeter
- Sematext
- Postgres-centric monitoring solutions
- EnterpriseDB Postgres Enterprise Manager
- pganalyze
- pgwatch2
- pg_statsinfo & pg_stats_reporter
- PGObserver
- pgCluu
- PoWA
- OPM: Open PostgreSQL Monitoring
- PASH-Viewer: PostgreSQL Active Session History Viewer
- Datasentinel
- temBoard
- Awide
- 参考
简介
常见的监控工具:
- PMM
- pgwatch2
- powa
- pgcenter
- prometheus+grafana
- zabbix
- 等等。。。。
官方文档中有关监控的章节:
http://www.postgres.cn/docs/14/monitoring.html
https://www.postgresql.org/docs/14/monitoring.html
监控软件的罗列文档:
https://wiki.postgresql.org/wiki/Monitoring
常见监控软件
Statistics collector
PostgreSQL collects lots of data on its own and offers it via the pg_stat(io)_
system views
- Official documentation on the Statistics Collector
- Interpreting pg_stat Views
contrib extensions
The following extensions offer access to Postgres internals which may be of interest or collect additional information. Most of them are shipped with Postgres (the -contrib
packages may need to be installed) and can be activated via the extension interface.
pg_stat_statements
pg_stat_statements
tracks all queries that are executed on the server and records average runtime per query "class" among other parameters.
pg_stat_plans
pg_stat_plans
extends on pg_stat_statements and records query plans for all executed quries. This is very helpful when you're experiencing performance regressions due to inefficient query plans due to changed parameters or table sizes.
pgstattuple
pgstattuple
can generate statistics for tables and indexes, showing how much space in each table & index is consumed by live tuples, deleted tuples as well as how much unused space is available in each relation.
pg_buffercache
pg_buffercache
gives you introspection into Postgres' shared buffers, showing how many pages of which relations are currently held in the cache.
External projects
CLI tools
pg_view
pg_view
is a Python-based tool to quickly get information about running databases and resources used by them as well as correlate running queries and why they might be slow.
pg_activity
pg_activity
is a htop like application for PostgreSQL server activity monitoring, written in Python.
pgmetrics
pgmetrics
collects a lot of information and statistics from a running PostgreSQL server and displays it in easy-to-read text format or export it as JSON for scripting.