ITPub博客

首页 > 数据库 > 国内数据库 > GBase8a使用系统表统计表空间各目录大小

GBase8a使用系统表统计表空间各目录大小

原创 国内数据库 作者:lbfv 时间:2021-05-31 14:57:02 0 删除 编辑

performance_schema.CLUSTER_DISK_USAGE_INFO 的统计走的是系统调用,通过系统函数 statfs 统计空间容量,而不是 du 命令。 执行步骤是: ( 1 )查询 CLUSTER_DISK_USAGE_INFO 首先是将命令下发到各个节点,查询各个节点的 performance_schema.DISK_USAGE_INFO 表,然后向 gcluster 层汇总 ( 2 ) performance_schema.DISK_USAGE_INFO 表信息通过系统命令 statfs 统计 系统表 performance_schema.CLUSTER_DISK_USAGE 确认 SIZE 、 USED 、 AVAIL 几列走的是 statfs 系统调用。 DIR_SIZE 列走的是 lstat 调用,会排查每个文件的大小,在表多、列多的场景下效率较慢。 strace - tT - f - e trace =fstat - o du.log du /opt/gnode/userdata/gbase/ strace - tT - f - e trace =fstat,lstat,statfs du /opt/gnode/userdata/gbase/ strace - tT - f - e trace =lstat - p ` pidof gbased ` strace - tT - f - o 1.txt - e trace =lstat - p ` pidof gbased ` strace - tT - f - o 2.txt - e trace =newfstatat du /opt/gnode/userdata/gbase/

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69979511/viewspace-2774694/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2020-07-28

  • 博文量
    56
  • 访问量
    30294