PG监控方法总结

0    112    1

Tags:

👉 本文共约4896个字,系统预计阅读时间或需19分钟。

简介

常见的监控工具:

  • 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

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.

本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信db_bao,谢谢!
PG监控方法总结后续精彩内容已被小麦苗无情隐藏,请输入验证码解锁本站所有文章!
验证码:
请先关注本站微信公众号,然后回复“小麦苗博客”,获取验证码。在微信里搜索“DB宝”或者“www_xmmup_com”或者微信扫描右侧二维码都可以关注本站微信公众号。

标签:

Avatar photo

小麦苗

学习或考证,均可联系麦老师,请加微信db_bao或QQ646634621

您可能还喜欢...

发表回复

嘿,我是小麦,需要帮助随时找我哦。另外,Oracle和MySQL OCP包过哟,可随时联系麦老师。
  • 18509239930
  • 个人微信

  • 麦老师QQ聊天
  • 个人邮箱
  • 点击加入QQ群
  • 个人微店

  • 回到顶部

麦老师提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信db_bao,非诚勿扰,谢谢!