Skip to content

Article

Articles on PostgreSQL monitoring, diagnosis, capacity, and logging, originally published at vonng.com. Each article retains its publication date, authorship, figures, and historical context. English translations accompany the Chinese originals.

For current installation and operation, use the PG Exporter manuals.

Article
Adopting the Victoria observability stack in Pigsty Monitoring
PGCon.Dev 2024: The Week PostgreSQL Commits Paused PostgreSQLPG Ecosystem
PostgreSQL Macro Query Optimization with pg_stat_statements PostgreSQLPG AdminPerformance
Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases PigstyMonitoringRDS
Diagnose PostgreSQL slow queries PostgreSQLPG AdminPerformance
The First Pigsty Release PigstyMonitoring
Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation PostgreSQLPG AdminMonitoring
Introducing Pigsty, a PostgreSQL Monitoring System PigstyMonitoringPostgreSQL
PostgreSQL's KPI PostgreSQLPG AdminMonitoring
An Overview of PostgreSQL Monitoring PostgreSQLMonitoringAdministration
Relation Bloat Monitoring and Management PostgreSQLPG Admin
Monitoring Table Size in PostgreSQL PostgreSQLPG AdminMonitoring
PostgreSQL Server Log Configuration PostgreSQLPG AdminMonitoring

PostgreSQL's KPI

Vonng 1532 words 8 min

PG Load measures accumulated transaction time per second, normalized by a chosen concurrency value. This article derives the metric and shows how to use it for alerting and capacity assessment.

  • Adopting the Victoria observability stack in Pigsty

    By Vonng In Article 655 words 2 min

    VonngMonitoring

    Featured Image for Adopting the Victoria observability stack in Pigsty

    This article describes the Pigsty v4 beta in December 2025. While preparing Pigsty v4.0, I replaced the default Prometheus and Loki services with VictoriaMetrics and VictoriaLogs. I also added VictoriaTraces. The aim was to reduce storage and memory …

    This article describes the Pigsty v4 beta in December 2025. While preparing Pigsty v4.0, I replaced the default Prometheus and Loki services with VictoriaMetrics and VictoriaLogs. I also added VictoriaTraces. The aim was to reduce storage and memory …

  • PGCon.Dev 2024: The Week PostgreSQL Commits Paused

    By Vonng In Article 3070 words 15 min

    VonngPostgreSQLPG Ecosystem

    Featured Image for PGCon.Dev 2024: The Week PostgreSQL Commits Paused

    This is a June 2024 conference report. Roles, package counts, and proposals reflect that event. PGCon, the predecessor to PGCon.Dev, was held in Ottawa from 2007 through 2023. It brought PostgreSQL developers together to discuss the project’s …

    This is a June 2024 conference report. Roles, package counts, and proposals reflect that event. PGCon, the predecessor to PGCon.Dev, was held in Ottawa from 2007 through 2023. It brought PostgreSQL developers together to discuss the project’s …

  • PostgreSQL Macro Query Optimization with pg_stat_statements

    By Nikolay Samokhvalov In Article 3926 words 19 min

    Nikolay SamokhvalovPostgreSQLPG AdminPerformance

    Featured Image for PostgreSQL Macro Query Optimization with pg_stat_statements

    This article describes the monitoring approach used in 2023. Its examples use PostgreSQL 15 fields and the dashboards available at that time. Slow queries increase response times and consume database resources. They can also prolong lock contention …

    This article describes the monitoring approach used in 2023. Its examples use PostgreSQL 15 fields and the dashboards available at that time. Slow queries increase response times and consume database resources. They can also prolong lock contention …

  • Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases

    By Vonng In Article 908 words 5 min

    VonngPigstyMonitoringRDS

    Featured Image for Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases

    This tutorial describes Pigsty and Alibaba Cloud services as used in September 2023. Commands, prices, and dashboard details reflect that period. Pigsty is a PostgreSQL distribution. You can also use it solely to monitor PostgreSQL and hosts. This …

    This tutorial describes Pigsty and Alibaba Cloud services as used in September 2023. Commands, prices, and dashboard details reflect that period. Pigsty is a PostgreSQL distribution. You can also use it solely to monitor PostgreSQL and hosts. This …

  • Diagnose PostgreSQL slow queries

    By Vonng In Article 559 words 3 min

    VonngPostgreSQLPG AdminPerformance

    Featured Image for Diagnose PostgreSQL slow queries

    This walkthrough uses the Pigsty sandbox and dashboards from February 2021. Slow queries occupy connections, hold locks, and consume CPU and I/O. On a standby, a long query can conflict with WAL replay. PostgreSQL can delay replay or cancel the …

    This walkthrough uses the Pigsty sandbox and dashboards from February 2021. Slow queries occupy connections, hold locks, and consume CPU and I/O. On a standby, a long query can conflict with WAL replay. PostgreSQL can delay replay or cancel the …

  • The First Pigsty Release

    By Vonng In Article 412 words 2 min

    VonngPigstyMonitoring

    Featured Image for The First Pigsty Release

    This article describes Pigsty at its January 2021 release. Today, I released Pigsty. Official website: pigsty.cc What is Pigsty? Pigsty monitors large PostgreSQL fleets and automates the deployment of highly available clusters. It is free, …

    This article describes Pigsty at its January 2021 release. Today, I released Pigsty. Official website: pigsty.cc What is Pigsty? Pigsty monitors large PostgreSQL fleets and automates the deployment of highly available clusters. It is free, …

  • Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation

    By Vonng In Article 812 words 4 min

    VonngPostgreSQLPG AdminMonitoring

    Featured Image for Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation

    Written in 2020. The metric counts and examples describe the deployment at that time. Preface Operating a database is like driving a car: both require attention to a dashboard. Metrics show the current state and help you decide when to act. Cars …

    Written in 2020. The metric counts and examples describe the deployment at that time. Preface Operating a database is like driving a car: both require attention to a dashboard. Metrics show the current state and help you decide when to act. Cars …

  • Introducing Pigsty, a PostgreSQL Monitoring System

    By Vonng In Article 1666 words 8 min

    VonngPigstyMonitoringPostgreSQL

    Featured Image for Introducing Pigsty, a PostgreSQL Monitoring System

    This article presents Pigsty as it stood in May 2020. Metric counts and dashboard names describe that system. I recently built a database monitoring system called Pigsty. This article describes its architecture, dashboards, and metrics. Pigsty uses …

    This article presents Pigsty as it stood in May 2020. Metric counts and dashboard names describe that system. I recently built a database monitoring system called Pigsty. This article describes its architecture, dashboards, and metrics. Pigsty uses …

  • PostgreSQL's KPI

    By Vonng In Article 1532 words 8 min

    VonngPostgreSQLPG AdminMonitoring

    Featured Image for PostgreSQL's KPI

    Written in 2020. This article develops a load indicator from PgBouncer transaction time. PG Load measures accumulated transaction time per second, divided by a chosen concurrency value. It combines the amount of work a database handles with the time …

    Written in 2020. This article develops a load indicator from PgBouncer transaction time. PG Load measures accumulated transaction time per second, divided by a chosen concurrency value. It combines the amount of work a database handles with the time …

  • An Overview of PostgreSQL Monitoring

    By Vonng In Article 825 words 4 min

    VonngPostgreSQLMonitoringAdministration

    Featured Image for An Overview of PostgreSQL Monitoring

    This article describes a monitoring system from December 2018. Its dashboard layout and statistics-collector details belong to that period. Using monitoring to manage PostgreSQL Managing PostgreSQL requires an understanding of its operating state. …

    This article describes a monitoring system from December 2018. Its dashboard layout and statistics-collector details belong to that period. Using monitoring to manage PostgreSQL Managing PostgreSQL requires an understanding of its operating state. …

  • Relation Bloat Monitoring and Management

    By Vonng In Article 2687 words 13 min

    VonngPostgreSQLPG Admin

    Featured Image for Relation Bloat Monitoring and Management

    This article was written in 2018. It explains statistics-based bloat estimates and maintenance practices from that period. PostgreSQL uses MVCC to let transactions work with different row versions. Old versions can leave tables and indexes larger …

    This article was written in 2018. It explains statistics-based bloat estimates and maintenance practices from that period. PostgreSQL uses MVCC to let transactions work with different row versions. Old versions can leave tables and indexes larger …

  • Monitoring Table Size in PostgreSQL

    By Vonng In Article 954 words 5 min

    VonngPostgreSQLPG AdminMonitoring

    Featured Image for Monitoring Table Size in PostgreSQL

    This 2018 article explains physical storage for ordinary PostgreSQL tables. Table Storage Layout An ordinary table has its own storage and may also have a TOAST table: Main table: stores row data, relkind='r'. TOAST table: stores out-of-line values …

    This 2018 article explains physical storage for ordinary PostgreSQL tables. Table Storage Layout An ordinary table has its own storage and may also have a TOAST table: Main table: stores row data, relkind='r'. TOAST table: stores out-of-line values …

  • PostgreSQL Server Log Configuration

    By Vonng In Article 820 words 4 min

    VonngPostgreSQLPG AdminMonitoring

    Featured Image for PostgreSQL Server Log Configuration

    This article was written in 2018. The table definitions below use the 23-column PostgreSQL 10 CSV format, and the Filebeat example uses the legacy prospectors configuration. CSV logs can be imported into PostgreSQL tables or queried through file_fdw …

    This article was written in 2018. The table definitions below use the 23-column PostgreSQL 10 CSV format, and the Filebeat example uses the legacy prospectors configuration. CSV logs can be imported into PostgreSQL tables or queried through file_fdw …