You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 6, 2021. It is now read-only.
[postgres-checkup](https://gitlab.com/postgres-ai-team/postgres-checkup) is an ultimate open-source PostgreSQL database health check utility.
1
+
#About
2
+
Postgres Checkup ([postgres-checkup](https://gitlab.com/postgres-ai-team/postgres-checkup)) is a new-generation diagnostics tool that allows to collect deep analysis of a Postgres database health. It aims to detect and describe all current and potential issues in the fields of database performance, scalability and security, advising how to resolve or prevent them.
4
3
5
-
See its short descriptionwiththe full list of checks implementedandplanned here:https://gitlab.com/postgres-ai-team/postgres-checkup/wikis/HEALTH-CHECK-v3
4
+
Compared to a monitoring system, postgres-checkup goes deeper in database system and environment analysis, it combines numerious database internal characteristicswithdata about resources and OS into multiple comprehensive reports. These reports use formats which are easy readable both by humansandmachines and are extremely oriented to DBA problems solving. Monitoring systems constantly collect telemetry, they help to react to issues quicker and do post-mortem analyses. Checkups are needed for a different purpose: detect issues at very early stage, advising on how to prevent them. This procedure is to be done on a regular basis — weekly, monthly, or quarterly. Additionally, it is recommended to run it right right before and right after any major change in database server.
6
5
7
-
The observed data is saved in the form of JSON reports, ready to be consumed by machines.
8
-
The final reports are .md files, in Markdown format, to be read by humans.
6
+
The three key principles behind postgres-checkup:
9
7
10
-
The main goalis todetect bottlenecks and help to prevent performance and scalability issues.
8
+
-*Unobtrusiveness*: postgres-checkup’s impact on the observing systemisclosetozero. It does not use any heavy queries, keeping resource usage very low, avoids having the “observer effect”.
11
9
12
-
Example
13
-
===
10
+
-*Zero install* (on observed machines): it is able to analyze any Linux machine (including virtual machines), as well as Cloud Postgres instanced (such as Amazon RDs or Google Cloud SQL), not requiring any additional setup or any changes. It does, hovewer, require the privileged access (a DBA usually has it anyway).
14
11
15
-
Let's make a report for a project named`my-site_org-slony`:
16
-
Cluster`slony` contains two servers -`db1` and`db2`.
12
+
-*Complex analysis*: unlike most monitoring tools, which provide raw data, postgres-checkup combines data from various parts of the system (w.g.: internal Postgres stats are combined with knowledge about system resources in autovacuum setting and behavior analysis). Also, it analyzes the master database server together with all its replicas (e.g. to build the list of unused indexes).
13
+
14
+
#Reports structure
15
+
The two kinds of reports postgres-checkup produces for every check:
16
+
17
+
- JSON reports (*.json) — can be consumed by any program or service, or stores in some database.
18
+
19
+
- Markdown reports (*.md) — the main format for humans, may contain lists, tables, pictures. Being of native format for GitLab and GitHub, such reports are ready to be used, for instance, in their issue trackers, simplifying workflow. Markdown reports are derived from JSON reports.
20
+
21
+
Markdown reports can be converted to different formats such as HTML or PDF.
22
+
23
+
Each report consists of three sections:
24
+
1. Observations
25
+
1. Conclusions
26
+
1. Recommendations
27
+
28
+
##Installation
29
+
30
+
###Requirements
31
+
32
+
The supported OS of the observer machine (those from which the tool is to be executed):
33
+
34
+
* Linux (modern RHEL/CentOS or Debian/Ubuntu; others should work as well, but not yet tested);
35
+
* MacOS.
36
+
37
+
It has to have the following programs:
38
+
39
+
* bash
40
+
* psql
41
+
* coreutils
42
+
* jq >= 1.5
43
+
* golang >= 1.8
44
+
* awk
45
+
* sed
46
+
47
+
Nothing special has to be istalled on the observed machines. However, these machines must run Linux (again: modern RHEL/CentOS or Debian/Ubuntu; others should work as well, but not yet tested).
48
+
49
+
50
+
#Example of use
51
+
52
+
Let's make a report for a project named`prod1`:
53
+
Cluster`slony` contains two servers -`db1.vpn.local` and`db1.vpn.local`.
17
54
Postgres-checkup automatically detects which one is a master: