Skip to main content
Monitoring of PostgreSQL cluster and databases for 1C
Last update:

Monitoring of PostgreSQL cluster and databases for 1C

In PostgreSQL cloud databases for 1C, you can monitor the state of the cluster:

Cluster and database node metrics can also be exported in Prometheus format.

View the status of the node cluster

  1. In Control Panel, go to Cloud PlatformDatabases.
  2. Open the cluster page → Monitoring tab.
  3. Click Cluster Server Monitoring.

Cluster node metrics in the control panel

Average

vCPUHow many percent of the node cluster cores are loaded
Load

The average system load over a period of time. Indicates how many processes are processed by the cluster cores. The indicator is presented as three values — in one minute, five minutes and 15 minutes. These values should be no greater than the number of cores on the node.

MemoryMemory utilization excluding cache and operating system buffers in percent or gigabytes
DiskUsed disk space in percent or gigabytes

View the status of the databases

  1. In Control Panel, go to Cloud PlatformDatabases.
  2. Open the cluster page → Monitoring tab.
  3. Click Database Monitoring.
  4. Check out the available database metrics.

Database metrics in the control panel

ConnectionsNumber of connections for each database in the cluster and the total number of connections to all databases
Execution time of the longest queryExecution time of the longest query for a period of time
TransactionsNumber of transactions per second for each database in the cluster
Row operations

Number of transactions per second in the selected database:

  • tup_deleted — number of rows deleted by queries in the database per second;
  • tup_fetched — number of rows retrieved by queries in the database per second;
  • tup_inserted — number of rows inserted by queries in the database per second;
  • tup_returned — number of rows returned by queries in the database per second;
  • tup_updated — number of rows modified by queries in the database per second.
Cache hitsWhat percentage of data in the query was read from the cache — the ratio of blks_hit to the sum of blks_hit and blks_read.
LocksThe number of locks in each database in the cluster
DeadlocksNumber of mutual locks in each database
Connection pooler metrics

PgBouncer connection pooler metrics for the selected database:

  • Number of client connections to the pool;
  • number of active connections to the node;
  • waiting time for a response from a node;
  • maximum time a client waits in the queue.

View cluster status

  1. In Control Panel, go to Cloud PlatformDatabases.
  2. View the status in the cluster row → Status column.
ACTIVECluster available
CREATINGThe cluster is being created
UPDATINGChanges are applied to the cluster
RESIZINGThe cluster is scaled
ERRORAn error occurred, create a ticket
DISK FULL

The disk is full and the cluster is read-only. To get the cluster working on read and write, clean the disk or scale the cluster and select a configuration with larger disk size

DEGRADEDSome nodes in the cluster are unavailable
DELETINGCluster is being deleted

Disk fullness notifications

If the cluster disk is 80% full, a notification will automatically be sent to the account's email.

If the cluster disk is 95% or more full, the cluster will go to DISK_FULL status and will be read-only. To make the cluster work on read and write, clean disk or scale cluster and select a configuration with a larger disk size.

Clean disk

Open the transaction transaction_read_only = no and remove unnecessary data using one of the queries:

  • DROP TABLE — deletes the structure (data, privileges, indexes, constraints, triggers). Use when completely deleting a table with data and structure:

    BEGIN;
    SET transaction_read_only = no;
    DROP TABLE table_name;
    COMMIT;
  • TRUNCATE TABLE — deletes the contents of the table, while the structure is preserved. Works faster than DROP TABLE. Use when deleting all rows of a table while preserving the table structure:

    BEGIN;
    SET transaction_read_only = no;
    TRUNCATE TABLE table_name;
    COMMIT;
  • DELETE — use to delete specific rows.

    For your information

    We do not recommend using a DELETE FROM table WHERE ... query to clean up a disk. This query can create large size samples on large tables and place them on disk. The remaining free disk space may run out completely, leading to problems with PostgreSQL and the need to manually restore its operation.

Export metrics in Prometheus format

You can export metrics in Prometheus format and then customize monitoring and alerts for database clusters yourself. Historical information for clusters is not available — metrics are only requested in real time.

To export metrics, you need to get a monitoring token. The token gives access to the metrics of all clusters in a single project pool.

  1. In Control Panel, go to Cloud PlatformDatabases.

  2. Open the cluster page → Monitoring tab.

  3. In the Metrics in Prometheus block, click Manage tokens.

  4. Press Create.

  5. Enter the name of the token.

  6. Press Create. The token will be generated automatically.

  7. Add to the Prometheus configuration file:

    scrape_configs:
    - job_name: get-metrics-from-dbaas
    scrape_interval: 1m
    static_configs:
    - targets:
    - '<pool>.dbaas.selcloud.ru'
    scheme: https
    authorization:
    type: Bearer
    credentials: <monitoring_token>

    Specify:

    • <pool> is the pool in which the token is valid, e.g. ru-3. The address (URL) is region and pool dependent, can be viewed in URL list;
    • <monitoring_token> is the value of the monitoring token.
  8. The source of the metrics will appear at http://<localhost>:9090/targets.

    Specify <localhost> — the IP address where Prometheus is installed.

  9. Check out the available metrics-in-prometheus-format.

Metrics in Prometheus format

Prometheus-formatted metrics are provided for all clusters. A specific cluster can be found by the database cluster identifier in the ds_id label.

dbaas_memory_percentMemory utilization excluding cache and operating system buffers (RAM) in percent
dbaas_memory_bytesMemory utilization excluding cache and operating system buffers (RAM) in bytes.
dbaas_cpuCPU utilization on database cluster nodes in percent
dbaas_cpu_iowaitI/O wait time in percent
dbaas_disk_percentUsed disk space in percent
dbaas_disk_bytesDisk space occupied in bytes
dbaas_disk_read_iopsNumber of read operations per second
dbaas_disk_write_iopsNumber of write operations per second
dbaas_disk_read_bytesSpeed of reading data from disk in bytes per second
dbaas_disk_disk_write_bytesSpeed of writing data to disk in bytes per second
dbaas_node_load1Average system load in one minute. Indicates how many processes are being processed by the cluster cores
dbaas_node_load5Average system load over five minutes. Indicates how many processes are processed by the cluster cores
dbaas_node_load15Average system load in 15 minutes. Indicates how many processes are processed by the cluster cores
network_receive_bitsNumber of bits received over the network interface
network_transmit_bitsNumber of bits sent over the network interface
network_receive_packetsNumber of packets received over the network interface per second
network_transmit_packetsNumber of packets sent over the network interface per second