nebula importer 入图性能问题咨询

  • nebula 版本:3.6.0
  • 部署方式:分布式
  • 安装方式:DEB
  • 硬件信息
    • 磁盘 SSD 每台机器6块 每块14T 共三台机器
    • CPU 48核 96线程
      -内存 每台 1T
  • 问题的具体描述
    • 入图配置
client:
  version: v3
  address: 192.168.56.75:9669,192.168.56.77:9669,192.168.56.79:9669
  user: root
  password: *
  concurrencyPerAddress: 96
  retry: 3
manager:
  spaceName: first_transaction_graph_data
  batch: 5000
  readerConcurrency: 50
  importerConcurrency: 500
  statsInterval: 10s
log:
  level: INFO
  console: true
  files:
    - logs/nebula-importer.log
sources:
  - hdfs:
      address: 192.168.56.75:9820
      user: "user"
      path: /jzd_data/processed_data/dwd/dwd_eoa_token_transfer/csv/part-*.csv
    csv:
      delimiter: ','
      withHeader: true
    tags:
      - name: token_transfer
        id:
          type: string
          index: 0
          function: null
        props:
          - name: tx_id
            type: string
            index: 0
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: transactionHash
            type: string
            index: 1
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: account
            type: string
            index: 2
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: tokenAddress
            type: string
            index: 3
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: tokenSymbol
            type: string
            index: 6
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: value
            type: string
            index: 7
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: from_balance_before
            type: string
            index: 8
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: from_balance_after
            type: string
            index: 9
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: to_balance_before
            type: string
            index: 10
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: to_balance_after
            type: string
            index: 11
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: logIndex
            type: int
            index: 12
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: blockNumber
            type: int
            index: 13
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: blockHash
            type: int
            index: 14
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: amountRaw
            type: int
            index: 15
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: valueDecimal
            type: string
            index: 16
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: blockTimestamp
            type: string
            index: 17
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: dayTimeSlot
            type: string
            index: 18
            nullable: false
            nullValue: ""
            defaultValue: null
          - name: weekTimeSlot
            type: string
            index: 19
            nullable: false
            nullValue: ""
            defaultValue: null
    edges:
      - name: to_token_transcation
        src:
          id:
            type: string
            index: 0
            function: null
        dst:
          id:
            type: string
            index: 5
            function: null
      - name: from_token_transcation
        src:
          id:
            type: string
            index: 4
            function: null
        dst:
          id:
            type: string
            index: 0
            function: null

总共大概有10亿个点,20亿条边,每个点的属性有18个,边没有属性

  • 调整过的配置
    • rocks db配置:“max_subcompactions”:“48”,“max_background_jobs”:“48”
    • num_io_threads=16 → 48
    • rocksdb_block_cache=4 → 1024 → 265216(差不多 可用内存的 1/3)
    • wal_ttl 14400s → 600s
    • enable_partitioned_index_filter=true

目前发现一个现象就是:刚开始的时候速度很快,但后边就开始慢下来了,延迟时间边长,内存占用也越来越高,大家有什么优化的建议吗?

前20s

{"level":"info","ts":"2024-02-22T16:23:56+08:00","caller":"manager/manager.go:416","msg":"10s 217h18m31s 0.00%(6.5 MiB/498 GiB) Records{Finished: 15000, Failed: 0, Rate: 1492.24/s}, Requests{Finished: 866, Failed: 0, Latency: 1.748142121s/1.78757646s, Rate: 86.15/s}, Processed{Finished: 4330000, Failed: 0, Rate: 430760.32/s}"}
{"level":"info","ts":"2024-02-22T16:24:06+08:00","caller":"manager/manager.go:416","msg":"20s 2h22m9s 0.23%(1.2 GiB/498 GiB) Records{Finished: 2740000, Failed: 0, Rate: 136656.38/s}, Requests{Finished: 2249, Failed: 0, Latency: 1.882997341s/1.927818606s, Rate: 112.17/s}, Processed{Finished: 11245000, Failed: 0, Rate: 560839.79/s}"}

40分钟后

{"level":"info","ts":"2024-02-22T17:03:56+08:00","caller":"manager/manager.go:416","msg":"40m10s 3h46m35s 15.06%(75 GiB/498 GiB) Records{Finished: 175930000, Failed: 0, Rate: 72998.45/s}, Requests{Finished: 105948, Failed: 0, Latency: 5.862058673s/5.912175018s, Rate: 43.96/s}, Processed{Finished: 529740000, Failed: 0, Rate: 219804.46/s}"}
{"level":"info","ts":"2024-02-22T17:04:06+08:00","caller":"manager/manager.go:416","msg":"40m20s 3h47m8s 15.08%(75 GiB/498 GiB) Records{Finished: 176190000, Failed: 0, Rate: 72804.28/s}, Requests{Finished: 106146, Failed: 0, Latency: 5.872702963s/5.922899325s, Rate: 43.86/s}, Processed{Finished: 530730000, Failed: 0, Rate: 219305.37/s}"}

你这个 batch 设置太大了,你可以适当调小点,搞成 1000 看看。

你空了的话,可以看看这个文章实施同学对导入速率的看法:如何提升 meta 性能?提高 TTL 删除速率?主备集群怎么做…Happy Office Hour 第一期会议纪要告诉你

为什么我中断入图之后,storaged的内存下不去呢

参考下这个文章:一文科普 RocksDB 工作原理

nebula 底层的存储引擎是 rocksdb,你停止入库的话不代表里面的数据就立马停止处理了。