Skip to main content

PostgreSQL metrics

Database metrics are a comprehensive collection of database workloads and resource usages. The WhaTap monitoring service continuously collects metric data to identify bottlenecks in the database and provides data to help identify the root cause of the performance issue.

For more information about other metrics, see the link.

active_sessions-Total number of connections for queryConnection
blk_read_timemillisecondTime spent writing data file blocks on the backendI/O
blk_write_timemillisecondTime spent writing data file blocks on the backendI/O
blks_hit-Total count where a disk block was found in the buffer cache and did not require a readI/O
blks_hit_ratiopctIt indicates the buffer cache hit rate. This can be calculated by sum(blks_hit)/sum(blks_hit + blks_read) * 100.I/O
blks_read-Number of disk blocks read from the databaseI/O
buffers_checkpoint-Total number of buffers written by the checkpointer processInfo
check_point-checkpoint execution countTroughput
checkpoint_write_timemillisecondTotal time in milliseconds for disk write caused by the checkpoint operationTroughput
checkpoints_timed-Number of checkpoint operations according to the checkpoint_timeout settingTroughput
commit_count-Number of transactions in the database committedTroughput
conflicts-Number of queries that were aborted because they conflicted with database recovery operationsTroughput
connect_error-Counted number when the agent failed to access the databaseConnection
deadlock_count-Total number of deadlocks detected in the databasePerformance
dml_count-Number of DML executionsTroughput
index_hit_ratiopctRate at which indexes were read from the buffer cachePerformance
lock_wait_sessions-Number of sessions waiting for a lockPerformance
long_running_sessions-Number of sessions running for more than the long running time (default:10 seconds)Performance
max_connections-This value is set in pg_settings for the maximum number of possible connections. If it is not enough, FATAL ERROR: too many clients already. Errors may occur.Info
node_state-This database consists of replication relationships. 1: Master, 2: Slave.Info
numbackends-Number of connected backendsInfo
replication_count-Number of replication databases (Slave)Performance
replication_delay-Delay time reflected in the replication database for the replication structure, this is a metric measured in the slave DBPerformance
rollback_count-Total number of transactions in the database rolled backPerformance
table_hit_ratio-Rate at which the tables were read from the buffer cachePerformance
temp_bytes-Total amount of data written to temporary files by queries in the databasePerformance
temp_files-Total number of temporary files generated by queries in the databasePerformance
total_runtime-Sum of runtimes (elapsed time) for all active sessionsPerformance
total_sessions-Total number of connected sessionsConnection
tup_deleted-Total number of rows deleted by the queries in the databaseTroughput
tup_fetched-Total number of rows fetched by the queries in the databaseTroughput
tup_inserted-Total number of rows added by the queries in the databaseTroughput
tup_returned-Number of rows returned by the queries in the databaseTroughput
tup_updated-Total number of rows updated by the queries in the databaseTroughput
vacuum_running_count-Number of processes for vacuumingPerformance
wait_sessions-Total number of queued connectionsPerformance
seq_scan-Method to read records during full table scanning.
Select this when any index does not exist or if an index exists, the range to be read is wide. This metric has the values queried every minute.
idx_scan-With this method, table records are accessed using keys stored in index leaf blocks. This metric has values retrieved every minute.Performance
wal-Number of WAL files. Spikes in the WAL file counts are usually caused by the large amount of changes in a short period or vacuum-like maintenance operations that generate temporary tables and objects. They should slowly return to normal levels. This usually results in lots of disk I/O and CPU activity, slowing the application query's execution until things get back to normal. This metric has the values queried every minute.Performance
cpu(xos2)pctCPU utilization, cpu_user + cpu_sys + cpu_iowait.XOS
cpu_user(xos2)pctTime spent for CPU to execute user codeXOS
cpu_sys(xos2)pctTime spent for CPU to execute the kernel codeXOS
cpu_iowait(xos2)pctCPU time waited for IOXOS
cpu_idle(xos2)pctCPU processor's idle timeXOS
mem(xos)pctMemory utilizationXOS
mem_total(xos)MBTotal amount of memoryXOS
mem_free(xos)MBAmount of memory not in use by the systemXOS
mem_used(xos)MBAmount of memory in use by the systemXOS
mem_buffcache(xos)MBAmount of memory used by the buff/cacheXOS
mem_swaptotal(xos)MBSet this in preparation for the case where the total Swap size and physical memory are insufficient.XOS
mem_swapfree(xos)MBBecause the unused Swap area and Swap area are secured in disk space, the system performance may drop drastically while using Swap.XOS
mem_available(xos)MBAvailable memory areaXOS
disk_reads(xos)blockAmount of data read from diskXOS
disk_read_bytes(xos)byteAmount of data read from diskXOS
disk_writes(xos)blockAmount of data written to diskXOS
disk_write_bytes(xos)byteAmount of data written to diskXOS
net_recv_bytes(xos)byteAmount of data received over the networkXOS
net_recv_packets(xos)-Number of data packets received over the networkXOS
net_send_bytes(xos)byteAmount of data transmitted over the networkXOS
net_send_packets(xos)-Number of data packets transmitted over the networkXOS