Planet PostgreSQL

Planet PostgreSQL -

Halil Ozan Akgul: Tenant monitoring in Citus & Postgres with citus_stat_tenants

If you have ever used a database like Postgres, you know how important optimization is. Some minor changes in how the database is setup make all the difference between long waiting times and satisfied customers. And one crucial thing you need before doing the optimization is to monitor and understand how your database is being used. Citus is an extension to Postgres that improves scalability and parallelization by distributing your Postgres database across nodes in a cluster. The Citus database extension is available as open source and as a managed service on the cloud, as Azure Cosmos DB for PostgreSQL. You can track your Citus nodes and the Postgres tables, but Citus 11.3 takes it one step further and introduces a new way to gather insight on your Citus database with tenant monitoring. The new Citus 11.3 release, among many other features, introduces a new citus_stat_tenants view to track your most active tenants, for those with multi-tenant SaaS applications. In a multi-tenant SaaS application, the same database stores data from the multiple customers of the application. Each of the customers are often referred as tenants. Usually the data for each tenant is handled separately. When you distribute your Postgres table using the Citus create_distributed_table function, every partition key value represents a tenant. With the new citus_stat_tenants view you can track: read query count, SELECT queries, total query count, SELECT, INSERT, DELETE, and UPDATE queries, total CPU usage in seconds In this post, you’ll learn how to monitor your top tenants to make more-informed decisions on your database—and you’ll learn how to configure citus_stat_tenants to best fit your application. This post includes a quickstart and code examples. Let’s explore: Monitor your top tenants with citus_stat_tenants Monitoring tenants in real time Insights on the most active tenants (versus on all tenants) Citus stores extra data to ensure consistency of tenant-l[...]

Citus 11.3是Postgres的扩展,通过在集群中分布数据库来提高可扩展性和并行性。新版本引入了一个citus_stat_tenants视图,用于跟踪多租户SaaS应用程序中最活跃的租户。该视图允许用户跟踪读取查询计数、总查询计数和CPU使用时间。租户监控功能旨在帮助用户收集有关其最活跃租户的信息。租户监视器将显示前citustat_tenants_limit个租户,仅限于当前和上一个周期。Citus存储额外的数据以确保租户级别统计数据的一致性。用户可以从任何节点查询citus_stat_tenants,视图将显示来自整个集群的统计信息。

Citus Postgres 多租户 扩展 监控

相关推荐 去reddit讨论

热榜 Top10

观测云
观测云
LigaAI
LigaAI
Dify.AI
Dify.AI
eolink
eolink

推荐或自荐