【问题标题】:neo4j breadth first traversal memory issueneo4j 广度优先遍历内存问题
【发布时间】:2015-06-10 23:03:21
【问题描述】:

我有一个加载到 Neo4j 中的包含数百万个节点和 300 万条边的图。它在进行广度优先遍历时崩溃,抱怨 8 GB 机器上的内存不足。每个节点标签字符串的平均长度为 40 个字符。

Neo4j 使用什么样的内部表示需要这么多内存,尤其是。遍历?鉴于 Neo4j 能够表示整个图,为什么它在尝试维护广度优先遍历所需的访问节点集时会失败。

根据我的理解,上述图形的邻接列表格式的图形表示应该以 MB 为单位。 计算假设节点和边的 64 位表示

  • 300万条边*8字节*3=72M(节点链接节点)
  • 100 万个节点 *(40 + 8 + 8 个字节)= 56 M(64 位哈希链接到节点字符串标签)

【问题讨论】:

    标签: optimization graph neo4j graph-databases internals


    【解决方案1】:

    宾果游戏@brian-underwood!你说的对。

    我没有将 Neo4J 配置为使用更多内存。

    由于问题仅与节点有关,以下是我修改的内容

    • neostore.nodestore.db.mapped_memory=256M # 增加
    • neostore.relationshipstore.db.mapped_memory=3G # 不变
    • neostore.propertystore.db.mapped_memory=256M # 增加
    • neostore.propertystore.db.strings.mapped_memory=200M # 不变
    • neostore.propertystore.db.arrays.mapped_memory=200M # 不变

    也启用了节点及其键的自动索引

    • node_auto_indexing=true
    • node_keys_indexable=key_name

    【讨论】:

      【解决方案2】:

      您可能有 8 GB 可用空间,但您是否正在配置 Neo4j 以允许它使用该空间?你能看到它在工作时占用了多少空间吗?

      这里有一些资源:

      http://neo4j.com/developer/guide-performance-tuning/

      http://neo4j.com/docs/stable/server-performance.html

      http://neo4j.com/docs/stable/configuration-settings.html#config_neostore.nodestore.db.mapped_memory

      http://neo4j.com/developer/guide-sizing-and-hardware-calculator/

      【讨论】:

      • 我不确定我是否应该接受你的回答有点高,或者我的回答会自我评分:(
      • 无论如何,我喜欢积分,但只要它有效,并且任何东西都可供路过的其他人使用;)
      • neostore.nodestore.db.mapped_memory=256M # 增加 neostore.relationship.db.mapped_memory=3G # 不变 neostore.propertystore.db.mapped_memory=256M # 增加 neostore.propertystore.db.strings.mapped_memory =200M # 不变 neostore.propertystore.db.arrays.mapped_memory=200M # 不变
      猜你喜欢
      • 1970-01-01
      • 2013-11-03
      • 1970-01-01
      • 2019-08-10
      • 1970-01-01
      • 2016-02-15
      • 2011-07-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多