tencent cloud

All product documents
TencentDB for PostgreSQL
Process Monitoring
Last updated: 2024-03-20 10:32:43
Process Monitoring
Last updated: 2024-03-20 10:32:43

Feature Background

In certain common scenarios, customer applications need not only the overall monitoring information of the database instance, but also need to use the process monitoring information in the instance to judge the business health, and then make business logic decisions. Typically, in SaaS scenarios, a single tenant of the user uses a database of the database instance alone. By monitoring the resource usage of the processes connected to the database, the business party can further judge the current health of the tenant and other situations.

Description of the Feature

TencentDB for PostgreSQL provides process monitoring information for the database instance. The system provides a view named tencentdb_process_system_usage, which contains the following information, as explained below:
Field name
Description
pid
Process Number.
username
Username.
datname
Database Name.
backend_type
Process type. Possible types include autovacuum launcher, autovacuum worker, logical replication launcher, logical replication worker, parallel worker, background writer, client backend, checkpointer, startup, walreceiver, walsender, and walwriter. In addition, backend Workers registered by extensions may have additional types.
query
Refers to the query statement that is being executed currently.
cpu_usage
Refers to the CPU utilization during the current query sampling period. For the sampling interval, the parameter tencentdb_system_stat.sampling_interval is provided for settings. The unit of this parameter is milliseconds and the default value is 1000.
memory_bytes
Refers to the memory usage rate during the current sampling period, in bytes.

Use Instructions

1. Create a new extension with the following command:
postgres => create extension tencentdb_system_stat;
CREATE EXTENSION
postgres =>
2. The usage of the tencentdb_process_system_usage view is the same as other views. You only need to log in to the PostgreSQL database instance and perform a query. Here is an example statement:
select * from tencentdb_process_system_usage;



Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon