docker环境下查看system_memory_high_watermark_ratio、memory_tracker_limit_ratio运行内存和资源,日志显示异常

在发帖子之前已仔细阅读过:
相关帖子:https://discuss.nebula-graph.com.cn/t/topic/12614
参数文档:https://docs.nebula-graph.com.cn/3.5.0/5.configurations-and-logs/1.configurations/3.graph-config/

测试目的:
为了测试nebula服务器运行的稳定性,防止因查询占满服务器资源而导致宕机问题的发生,在本地做nebula安全参数设置测试。

部署环境:
nebula混合部署,虚拟机本地运行内存2G,硬盘30G,处理器4核。
docker-compose.yml配置内容如下。
version: '3.4'
services:
  metad0:
    image: vesoft/nebula-metad:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad0
      - --ws_ip=metad0
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad0:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - 19559
      - 19560
    volumes:
      - /mnt/nebula/data/meta0:/data/meta
      - /mnt/nebula/logs/meta0:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  metad1:
    image: vesoft/nebula-metad:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad1
      - --ws_ip=metad1
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad1:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - 19559
      - 19560
    volumes:
      - /mnt/nebula/data/meta1:/data/meta
      - /mnt/nebula/logs/meta1:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  metad2:
    image: vesoft/nebula-metad:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=metad2
      - --ws_ip=metad2
      - --port=9559
      - --ws_http_port=19559
      - --data_path=/data/meta
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://metad2:19559/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9559
      - 19559
      - 19560
    volumes:
      - /mnt/nebula/data/meta2:/data/meta
      - /mnt/nebula/logs/meta2:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  storaged0:
    image: vesoft/nebula-storaged:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged0
      - --ws_ip=storaged0
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
      - --memory_tracker_limit_ratio=0.3
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged0:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - /mnt/nebula/data/storage0:/data/storage
      - /mnt/nebula/logs/storage0:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  storaged1:
    image: vesoft/nebula-storaged:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged1
      - --ws_ip=storaged1
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
      - --memory_tracker_limit_ratio=0.3
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged1:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - /mnt/nebula/data/storage1:/data/storage
      - /mnt/nebula/logs/storage1:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  storaged2:
    image: vesoft/nebula-storaged:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --local_ip=storaged2
      - --ws_ip=storaged2
      - --port=9779
      - --ws_http_port=19779
      - --data_path=/data/storage
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
      - --memory_tracker_limit_ratio=0.3
    depends_on:
      - metad0
      - metad1
      - metad2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://storaged2:19779/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - 9779
      - 19779
      - 19780
    volumes:
      - /mnt/nebula/data/storage2:/data/storage
      - /mnt/nebula/logs/storage2:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  graphd:
    image: vesoft/nebula-graphd:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd
      - --ws_ip=graphd
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
      - --system_memory_high_watermark_ratio=0.8
      - --memory_tracker_limit_ratio=0.5
      # enable log memory tracker stats periodically
      - --memory_tracker_detail_log=true
      # log memory tacker stats interval in milliseconds
      - --memory_tracker_detail_log_interval_ms=1000
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "9669:9669"
      - 19669
      - 19670
    volumes:
      - /mnt/nebula/logs/graph:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  graphd1:
    image: vesoft/nebula-graphd:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd1
      - --ws_ip=graphd1
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
      - --system_memory_high_watermark_ratio=0.8
      - --memory_tracker_limit_ratio=0.5
      # enable log memory tracker stats periodically
      - --memory_tracker_detail_log=true
      # log memory tacker stats interval in milliseconds
      - --memory_tracker_detail_log_interval_ms=1000
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd1:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "49155:9669"
      - 19669
      - 19670
    volumes:
      - /mnt/nebula/logs/graph1:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE

  graphd2:
    image: vesoft/nebula-graphd:v3.4.0
    environment:
      USER: root
      TZ:   "${TZ}"
    command:
      - --meta_server_addrs=metad0:9559,metad1:9559,metad2:9559
      - --port=9669
      - --local_ip=graphd2
      - --ws_ip=graphd2
      - --ws_http_port=19669
      - --log_dir=/logs
      - --v=1
      - --minloglevel=0
      - --system_memory_high_watermark_ratio=0.8
      - --memory_tracker_limit_ratio=0.5
      # enable log memory tracker stats periodically
      - --memory_tracker_detail_log=true
      # log memory tacker stats interval in milliseconds
      - --memory_tracker_detail_log_interval_ms=1000
    depends_on:
      - storaged0
      - storaged1
      - storaged2
    healthcheck:
      test: ["CMD", "curl", "-sf", "http://graphd2:19669/status"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 20s
    ports:
      - "49163:9669"
      - 19669
      - 19670
    volumes:
      - /mnt/nebula/logs/graph2:/logs
    networks:
      - nebula-net
    restart: on-failure
    cap_add:
      - SYS_PTRACE
  
  console:
    image: vesoft/nebula-console:nightly
    entrypoint: ""
    command: 
      - sh
      - -c
      - |
        for i in `seq 1 60`;do
          var=`nebula-console -addr graphd -port 9669 -u root -p nebula -e 'ADD HOSTS "storaged0":9779,"storaged1":9779,"storaged2":9779'`;
          if [[ $$? == 0 ]];then
            break;
          fi;
          sleep 1;
          echo "retry to add hosts.";
        done && tail -f /dev/null;

    depends_on:
      - graphd
    volumes:
      - /mnt/nebula/data/console:/setData
    networks:
      - nebula-net

networks:
  nebula-net:

这里查看部分日志显示如下:

这里8589934592.000GiB、4294967295.976GiB不可能有这么大。
sys:5.379MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:11:52.961030    30 ThriftClientManager-inl.h:67] resolve "storaged1":9779 as "172.20.0.7":9779
I20230713 09:11:52.968569    32 ThriftClientManager-inl.h:67] resolve "storaged1":9779 as "172.20.0.7":9779
I20230713 09:11:52.968569    33 ThriftClientManager-inl.h:67] resolve "storaged2":9779 as "172.20.0.5":9779
I20230713 09:11:52.969058    31 ThriftClientManager-inl.h:67] resolve "storaged0":9779 as "172.20.0.6":9779
I20230713 09:11:52.978278    30 ThriftClientManager-inl.h:67] resolve "storaged0":9779 as "172.20.0.6":9779
I20230713 09:11:52.978478    32 ThriftClientManager-inl.h:67] resolve "storaged2":9779 as "172.20.0.5":9779
I20230713 09:11:52.978485    31 ThriftClientManager-inl.h:67] resolve "storaged1":9779 as "172.20.0.7":9779
I20230713 09:11:52.986997    19 QueryInstance.cpp:128] Finish query: MATCH p=(v)-[*1..2]-(m) where id(v)=="1" and all( number in [n in nodes(p) where id(n)<>id(v) | n] where "frontPort" not in tags(number)) RETURN p 
I20230713 09:11:52.987042    19 ClientSession.cpp:52] Delete query, epId: 15
I20230713 09:11:53.528612    36 MemoryUtils.cpp:227] sys:5.844MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:11:54.529328    36 MemoryUtils.cpp:227] sys:5.777MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:11:55.528609    36 MemoryUtils.cpp:227] sys:5.777MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:11:57.527644    36 MemoryUtils.cpp:227] sys:5.574MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:11:59.527029    36 MemoryUtils.cpp:227] sys:5.543MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:00.526736    36 MemoryUtils.cpp:227] sys:5.375MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:01.078792    34 MetaClient.cpp:2660] Send heartbeat to "metad1":9559, clusterId 0
I20230713 09:12:01.079039    33 MetaClient.cpp:730] Send request to meta "metad1":9559
I20230713 09:12:01.081133    33 MetaClient.cpp:2678] Metad last update time: 1689239131995
I20230713 09:12:01.527021    36 MemoryUtils.cpp:227] sys:5.379MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:02.527484    36 MemoryUtils.cpp:227] sys:5.379MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:04.526829    36 MemoryUtils.cpp:227] sys:5.379MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:05.528107    36 MemoryUtils.cpp:227] sys:5.379MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:07.525780    36 MemoryUtils.cpp:227] sys:5.379MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:08.526571    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:09.526949    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:10.526650    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:11.084992    34 MetaClient.cpp:2660] Send heartbeat to "metad1":9559, clusterId 0
I20230713 09:12:11.085103    30 MetaClient.cpp:730] Send request to meta "metad1":9559
I20230713 09:12:11.086192    30 MetaClient.cpp:2678] Metad last update time: 1689239131995
I20230713 09:12:11.526981    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:12.526634    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:13.528594    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:15.527220    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:16.527266    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:17.527765    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:18.527294    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:19.526813    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:20.526661    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:20.886507    31 MetaClient.cpp:730] Send request to meta "metad1":9559
I20230713 09:12:21.096594    34 MetaClient.cpp:2660] Send heartbeat to "metad1":9559, clusterId 0
I20230713 09:12:21.096832    32 MetaClient.cpp:730] Send request to meta "metad1":9559
I20230713 09:12:21.099082    32 MetaClient.cpp:2678] Metad last update time: 1689239131995
I20230713 09:12:21.527191    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:22.526751    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:23.527767    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:25.528504    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:26.528261    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:28.526615    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:29.527295    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:30.527791    36 MemoryUtils.cpp:227] sys:5.270MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:31.101172    34 MetaClient.cpp:2660] Send heartbeat to "metad1":9559, clusterId 0
I20230713 09:12:31.101392    33 MetaClient.cpp:730] Send request to meta "metad1":9559
I20230713 09:12:31.103901    33 MetaClient.cpp:2678] Metad last update time: 1689239131995
I20230713 09:12:31.527364    36 MemoryUtils.cpp:227] sys:5.277MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:33.526968    36 MemoryUtils.cpp:227] sys:5.277MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:34.527468    36 MemoryUtils.cpp:227] sys:5.277MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
I20230713 09:12:35.527896    36 MemoryUtils.cpp:227] sys:5.277MiB/8589934592.000GiB 0.00% usr:33.000MiB/4294967295.976GiB 0.00%
1 个赞

容器环境确实有这样的问题,我之前也遇到过, @codesigner 有空看看?和我那天发给你的现象一样

请问有好的解决方案吗。

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。