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.
Adopting the Victoria observability stack in Pigsty
The December 2025 Pigsty v4 beta introduced VictoriaMetrics, VictoriaLogs, and VictoriaTraces. This article records the motivation, test results, and deployment model.
PGCon.Dev 2024: The Week PostgreSQL Commits Paused
Notes from PGCon.Dev 2024: extension packaging, observability, community discussions, and plans for PostgreSQL.
PostgreSQL Macro Query Optimization with pg_stat_statements
Query optimization is one of the core responsibilities of DBAs. This article introduces how to use metrics provided by pg_stat_statements for macro-level PostgreSQL query optimization.
Monitor Existing PostgreSQL with Pigsty: RDS, PolarDB, and Self-Hosted Databases
Deploy Pigsty on ECS and connect existing PostgreSQL databases, using Alibaba Cloud PolarDB and RDS for PostgreSQL as examples.
Diagnose PostgreSQL slow queries
Use query statistics, logs, and monitoring to find a slow query, test its cause, and verify a fix.
The First Pigsty Release
Introducing Pigsty's first release: PostgreSQL monitoring, high-availability cluster provisioning, and a local demo environment.
Golden Monitoring Metrics: Errors, Latency, Throughput, Saturation
Understanding the golden monitoring metrics in PostgreSQL
Introducing Pigsty, a PostgreSQL Monitoring System
The PostgreSQL monitoring system I built: its architecture, monitoring hierarchy, instance and cluster dashboards, and slow-query analysis.
PostgreSQL's KPI
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.
An Overview of PostgreSQL Monitoring
A tour of a PostgreSQL monitoring system: dashboards, architecture, key metrics, and the statistics behind them.
Relation Bloat Monitoring and Management
Estimate PostgreSQL table and index bloat from statistics, then use VACUUM FULL or pg_repack to reclaim space.
Monitoring Table Size in PostgreSQL
Measure PostgreSQL table storage, including indexes, TOAST, and relation forks.
PostgreSQL Server Log Configuration
CSV logs can be imported into PostgreSQL tables or queried through file_fdw for analysis.
-
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
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
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
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
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
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
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
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
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
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
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
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
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 …