查询当前租户的内存使用情况(OB V4)?

查询当前租户的内存使用情况(OB V4)?

2 个赞

这还不简单:
select * from gv$ob_tenant_memory;

3 个赞

ok

2 个赞

厉害了,学习~

1 个赞

厉害了,以后多向你学习

1 个赞

大佬厉害

1 个赞

谬赞~

1 个赞

夸奖了~

1 个赞

呵呵,不是大佬~

1 个赞

@论坛小助手

要查询当前租户的内存使用情况,可以在 sys 租户下通过查询 oceanbase.GV$OB_TENANT_MEMORY 视图实现。这个视图展示了当前 OBServer 节点进程中每个租户的内存使用状况。请参考以下 SQL 语句:

obclient> SELECT tenant_id, hold FROM oceanbase.GV$OB_TENANT_MEMORY WHERE svr_ip = 'xx.xx.xx.xx' AND svr_port=2882  GROUP BY tenant_id;

此外,还可以查看某个租户的内存使用详情。步骤如下:

  1. 登录 OBServer 节点所在的机器。
  2. 执行以下命令,进入日志文件所在的目录。
cd ~/oceanbase/log
  1. 使用 Vim 打开 observer.log
  2. 搜索 ob_malloc_allocator.cpp.*${租户ID} 来获取租户的详细内存使用情况。例如,对于租户ID为1002,可以执行:
/ob_malloc_allocator.cpp.*1002

查询结果示例:

[MEMORY] ctx_id=           DEFAULT_CTX_ID hold_bytes=    258,838,528 limit= 9,223,372,036,854,775,807
[MEMORY] ctx_id=          MEMSTORE_CTX_ID hold_bytes=     67,108,864 limit= 9,223,372,036,854,775,807
[MEMORY] ctx_id=         TRANS_CTX_MGR_ID hold_bytes=      2,097,152 limit= 9,223,372,036,854,775,807
[MEMORY] ctx_id=        PLAN_CACHE_CTX_ID hold_bytes=    132,120,576 limit= 9,223,372,036,854,775,807
[MEMORY] ctx_id=                WORK_AREA hold_bytes=      4,194,304 limit=               322,122,545
[MEMORY] ctx_id=          META_OBJ_CTX_ID hold_bytes=     22,093,824 limit=               644,245,090
[MEMORY] ctx_id=       TX_CALLBACK_CTX_ID hold_bytes=      2,097,152 limit= 9,223,372,036,854,775,807
[MEMORY] ctx_id=               LOB_CTX_ID hold_bytes=      2,097,152 limit= 9,223,372,036,854,775,807

更多信息请查看:

  1. 查看内存的使用信息
  2. V$OB_TENANT_MEMORY
  3. V$OB_MEMORY
1 个赞

你们两个也在互刷积分 警告一下 如果下次再这样 禁言

1 个赞

你也是在刷积分 如果在刷 禁言

1 个赞