【问题标题】:How to speed up combined ldap query?如何加快组合 ldap 查询?
【发布时间】:2013-04-11 15:03:58
【问题描述】:

这个 ldap 查询是即时的:

"Find all groups which user1 is not member"
(&
    (objectclass=groupOfNames)
    (!(member=cn=user1))
)

就像这个:

"Find these groups"
(&
    (objectclass=groupOfNames)
    (|(cn=group1) (cn=group2) (cn=group3) ...  )
)

但是,像这样组合它们会导致几分钟的处理!

"From these groups, find all which the user1 is not a member"
(&
    (objectclass=groupOfNames)
    (!(member=cn=user1))
    (|(cn=group1) (cn=group2) (cn=group3) ...  )
)

我不知道为什么 ldap 服务器会在组合查询中阻塞。有什么想法可以做吗?

如果有帮助,服务器是 Novell eDirectory。

【问题讨论】:

    标签: performance ldap edirectory


    【解决方案1】:

    奇怪的是需要几分钟才能得到结果。你有超过几百万个对象吗?

    一种可能性可能是,搜索 1 只在树的一个分区内查找,在另一个分区中搜索 2,然后两者结合起来显然会同时查找两者,这应该没问题,只要您询问的服务器有至少在这些分区上读取副本。

    另外,请您尝试以下变体:

    (&
    
      (&
        (objectclass=groupOfNames)(!(member=cn=user1))
      )
    
      (&
        (objectclass=groupOfNames)(|(cn=group1) (cn=group2) (cn=group3) ...  )
      )
    
    )
    

    它应该会给你你最初查询的答案,但方式有点简单。

    如果这没有帮助,你应该在被查询的服务器上做一个 ndstrace,看看他对查询做了什么。

    简而言之:

    1. 显然:确保您的 NDS 健康(ndsrepair、TID 3564075 等等)
    2. 检查两个查询是否在同一个分区中
    3. 检查服务器是否至少有分区的只读副本
    4. 尝试按照建议修改查询
    5. 在查询时执行 ndstrace 以查看花费了这么长时间的内容

    【讨论】:

      猜你喜欢
      • 2013-05-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多