PostgreSQL Monitoring
Users of Selectel Managed Databases can get information about the load on the cluster servers and working with databases. All data are presented in the form of graphs. The graphs can be viewed on the Monitoring tab on the cluster page.
Cluster Servers Watchers
vCPU
The graph shows the percentage of the cluster server cores loaded.
Load Average
The graph shows the average system load over a period of time. Load average shows the number of processes which are being executed by the cluster cores. The graph shows the indicator displayed as three values: for 1 minute, for 5 minutes, and for 15 minutes.
Memory Usage
The graph shows the taken memory without regard of the cache and OS buffers.
Disk Usage
The graph shows the used disk space.
Cluster Databases Watchers
Connections
Each line of the graph shows the number of connections to a particular cluster database. The graph also shows the total number of connections to all cluster databases.
Longest Query Execution Time
The graph shows the execution time of the longest query for the period.
Transactions
The graph shows the number of transactions per one second for each cluster database.
Row Operations
The graph shows the number of operations on all databases per one second. It shows the following types of operations:
- tup_returned – number of rows returned by queries in this database per one second;
- tup_fetched – number of rows fetched by queries in this database per one second;
- tup_inserted – number of rows inserted by queries in this database per one second;
- tup_updated – number of rows updated by queries in this database per one second;
- tup_deleted – number of rows deleted by queries in this database per one second.
Cache Hit
The graph shows the percentage of the data read from the cache in the request (the ratio of blks_hit
to the sum of blks_hit
and blks_read
).
Locks
The graph shows the number of locks for each cluster database.
Deadlocks
The graph shows the number of deadlocks recorded in each database.
Disk Fullness Notifications
If the cluster’s status has changed to DISK_FULL, then you can clean up the disk by opening a transaction with transaction_read_only = no
and deleting unnecessary data.
Please note that a statement like DELETE FROM table WHERE ...
in large tables can create large selections and place them on the disk. In this case, the disk may run out of space, which will lead to problems with PostgreSQL, and you’ll have to restore it manually. We do not recommend using DELETE FROM
to clean up the disk.
The first way to clean up the disk is to use DROP TABLE
:
BEGIN;
SET transaction_read_only = no;
DROP TABLE some_unused_table;
COMMIT;
The second way is to use TRUNCATE TABLE
:
BEGIN;
SET transaction_read_only = no;
TRUNCATE TABLE some_unused_table;
COMMIT;
TRUNCATE TABLE
is faster than the first command but deletes records from a table without removing table structure. DROP TABLE
removes the table structure (data, privileges, indexes, constraints, and triggers).
TRUNCATE TABLE
is best for removing all rows from a table and leaves the table structure — it’s faster than DROP TABLE
.
DROP TABLE
is best for removing an entire table, including its structure and data — it’s faster than DELETE
.
DELETE
is used to remove specific rows.