postgres=> \\dx;List of installed extensionsName | Version | Schema | Description-----------------------+---------+------------+------------------------------------------------------------------------pg_stat_log | 1.0 | public | track runtime execution statistics of all SQL statements executedpg_stat_statements | 1.9 | public | track planning and execution statistics of all SQL statements executedplpgsql | 1.0 | pg_catalog | PL/pgSQL procedural languagetencentdb_serverless | 1.0 | public | extension for serverless modetencentdb_system_stat | 1.0 | public | track execution statistics of querssy executed(5 rows)
postgres=> show tencentdb_serverless.min_cpu_cores;tencentdb_serverless.min_cpu_cores------------------------------------8(1 row)postgres=> show tencentdb_serverless.max_cpu_cores;tencentdb_serverless.max_cpu_cores------------------------------------8(1 row)
tencentdb_serverless.set_database_cpu_limit(database_name text [, min_cpu_cores numeric(5,1), max_cpu_cores numeric(5,1)])
postgres=> select tencentdb_serverless.set_database_cpu_limit('tenant_001',2,2.5);set_database_cpu_limit------------------------(1 row)
tencentdb_serverless.reset_database_limit(database_name text)
postgres=> select tencentdb_serverless.reset_database_limit('tenant_001');reset_database_limit----------------------(1 row)
tencentdb_serverless.reset_all_database_limit()
postgres=> select tencentdb_serverless.reset_all_database_limit();reset_all_database_limit--------------------------(1 row)
列名 | 含义 |
database_name | 数据库的名字 |
min_cpu_cores | 当前 database 可以使用的最小 CPU 核数 |
max_cpu_cores | 当前 database 可以使用的最大 CPU 核数 |
min_mem_kilobytes | 当前 database 可以使用的最大内存大小,单位为 kB。预留字段,暂时未使用。 |
max_mem_kilobytes | 当前 database 可以使用的最大内存大小,单位为 kB。预留字段,暂时未使用。 |
postgres=> select * from tencentdb_serverless.resource_limit_view;database_name | min_cpu_cores | max_cpu_cores | min_mem_kilobytes | max_mem_kilobytes---------------+---------------+---------------+-------------------+-------------------tenant_001 | 2.0 | 2.5 | |tenant_002 | 2.0 | 2.5 | |(2 rows)
postgres=> select datname,sum(cpu_usage) as cpu_usage from tencentdb_process_system_usage where datname !='NULL' group by datname;datname | cpu_usage------------+-----------postgres | 3tenant_001 | 1.99tenant_002 | 1(3 rows)
本页内容是否解决了您的问题?