暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Global CatCache

成子 2023-06-26
344

本文介绍了PolarDB PostgreSQL版的Global CatCache功能。

背景信息

原生PostgreSQL将Cat/Sys Cache保存在各个进程私有内存中,在连接数较多时,会消耗较多内存,部分极端场景下甚至出现OOM的风险。
PolarDB PostgreSQL版引用了Global CatCache功能,将Cat/Sys Cache保存在所有进程都可以访问的共享内存中,确保Cat/Sys Cache的内存消耗不再受连接数的影响,大大提高了服务稳定性。

参数说明

image.png

监控

所有监控接口都在polar_global_cache插件中,执行以下命令,创建插件。

create extension polar_global_cache;

polar_global_catcache_stat视图

您可以通过polar_global_catcache_stat视图查看Global CatCache的状态信息。

table polar_global_catcache_stat;
-[ RECORD 1 ]-------+----
elems               | 34
nlookup             | 853
nlookup_miss        | 852
ninsert             | 34
nmove               | 0
ndelete             | 0
ninvalidate         | 0
nflush              | 0
nevict              | 0
nevict_active       | 0
nevict_fail         | 0
nlookup_clist       | 41
nlookup_miss_clist  | 41
ninsert_clist       | 0
nmove_clist         | 0
ndelete_clist       | 0
ninvalidate_clist   | 0
nevict_clist        | 0
neivct_active_clist | 0
rehash_fail         | 0
meta_alloc_fail     | 0
data_alloc_fail     | 0
lru_active_len      | 0
lru_inactive_len    | 34
component_id        | 1

指标说明:
image.png

polar_catcache_stat视图

您可以通过polar_catcache_stat视图查看进程内部的CatCache的状态信息。
指标为polar_global_catcache_stat的子集,指标说明和polar_global_catcache_stat一致。

table polar_catcache_stat;
-[ RECORD 1 ]------+-----
nlookup            | 2060
nlookup_miss       | 898
ninsert            | 883
ndelete            | 753
ninvalidate        | 0
nevict             | 753
nevict_active      | 2
evict_fail         | 0
nlookup_clist      | 41
nlookup_miss_clist | 41
ninsert_clist      | 41
ndelete_clist      | 4
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论