Project

General

Profile

Actions

Architecture #17128

closed

review index for LDAP

Added by Nicolas CHARLES about 4 years ago. Updated almost 4 years ago.

Status:
Released
Priority:
N/A
Category:
Performance and scalability
Target version:
Effort required:
Name check:
To do
Fix check:
Checked
Regression:

Description

A long long time ago ( https://issues.rudder.io/issues/5965 ) we removed indexes within Rudder, by adding cache
Then we move to mdb, which doesn't have cache, but is super fast

It is fast, but some edge cases are unfortunately slow, or super slow. See for example https://issues.rudder.io/issues/12937 , or https://issues.rudder.io/issues/14945

We could improve perfs there, but we need also to measure what we are doing, as adding indexes make writing slower (and write is costly in ldap)


Related issues 5 (0 open5 closed)

Related to Rudder - Bug #5965: LDAP configuration is not optimized for Rudder use caseReleasedMatthieu CERDA2015-01-08Actions
Related to Rudder - Bug #12937: In Rudder 6.2.0 inventory processing merge_uuid part get extremelly slow on debianReleasedNicolas CHARLESActions
Related to Rudder - Bug #14945: Missing index in ldap directory ResolvedFrançois ARMANDActions
Related to Rudder - Bug #2751: Some ldap are not indexedReleasedJonathan CLARKE2012-08-01Actions
Related to Rudder - Bug #17215: create migration script for LDAP indexesReleasedBenoît PECCATTEActions
Actions #1

Updated by Nicolas CHARLES about 4 years ago

  • Related to Bug #5965: LDAP configuration is not optimized for Rudder use case added
Actions #2

Updated by Nicolas CHARLES about 4 years ago

  • Related to Bug #12937: In Rudder 6.2.0 inventory processing merge_uuid part get extremelly slow on debian added
Actions #3

Updated by Nicolas CHARLES about 4 years ago

  • Related to Bug #14945: Missing index in ldap directory added
Actions #4

Updated by Nicolas CHARLES about 4 years ago

  • Related to Bug #2751: Some ldap are not indexed added
Actions #5

Updated by Nicolas CHARLES about 4 years ago

as a reminder, indexes must be set with a stopped rudder-slapd, and then the command /opt/rudder/sbin/slapindex must be run - it is fairly slow (there's a -q option for quick)

unfortunately, we don't have the logs anymore of what is unidexed because of https://issues.rudder.io/issues/10429

Actions #6

Updated by Nicolas CHARLES about 4 years ago

On 6.1, after 1 days of operation, I have the following missing indexes (with occurences)

Equality

208 (agentName) not indexed
63694 (cn) not indexed
195618 (directiveId) not indexed
29 (isDynamic) not indexed
8 (isSystem) not indexed
26261 (nodeGroupId) not indexed
6117 (nodeId) not indexed
12905 (osName) not indexed
78 (policyServerId) not indexed
4 (software) not indexed
50578 (softwareVersion) not indexed

Inequality

14162 (modifyTimestamp) not indexed

Substring

416 (agentName) not indexed
3 (cn) not indexed
1 (ruleTarget) not indexed

stats

Dynamic group update are between 2m26 and 5M9, median at 3m19
Fetch rules at the begining of policy generation is between 17 and 342, median at 55ms
Inventory processing is between 3s711 and 9s57, with a median at 6s50
Get node infos: min 232, max 15501, av 444, median 368
Policy generation is around 13 or 14 minutes

Actions #7

Updated by Nicolas CHARLES about 4 years ago

testing with indexes

index cn eq
index softwareVersion eq
index directiveId eq

Interestingly, indexing with
/opt/rudder/sbin/slapindex -q
takes 2secondes on load platform

Stats

Dynamic groups update are between 2m30 and 3m30 (but there are only 12 recomputations)
Fetch rules at the begining of policy generation is between 21 and 100, median at 55
Inventory processing is between 160 and 928ms with a median at 215 ms
Get node info: min 171, max 63902, average 255, median 211
Policy generation is around 12m30-13m50

There aren't any visible regression. I had one IO issues when copying too much inventories at once but that was my mistake
Web interface feels faster (but that's hard to measure)

Remaining ldap missing index

For equality

     88 (agentName) not indexed
     11 (isDynamic) not indexed
     18 (isSystem) not indexed
  10105 (nodeGroupId) not indexed
   6264 (nodeId) not indexed
   4959 (osName) not indexed
     33 (policyServerId) not indexed
      8 (software) not indexed

Actions #8

Updated by Nicolas CHARLES about 4 years ago

Interestingly, add ing index

index nodeGroupId eq 

breaks the computation of dynamic groups for relays

[2020-04-22 00:17:04] ERROR scheduledJob - Error when updating dynamic group 'hasPolicyServer-0b448d1d-16c0-408e-a97c-4c8dfd1d352d' <- Inconsistency: Error when retrieving the entry for NodeGroup 'hasPolicyServer-0b448d1d-16c0-408e-a97c-4c8dfd1d352d

Actions #9

Updated by Nicolas CHARLES about 4 years ago

Finally, these index make everything much faster when a node is already there for inentory processing, but it's much less impressive when node is not yet accepted: we are still in the 3-5 secondes area if inventory was never seen

Actions #10

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES
Actions #11

Updated by Nicolas CHARLES about 4 years ago

  • Assignee changed from Nicolas CHARLES to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder-packages/pull/2249
Actions #12

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from In progress to Pending technical review
Actions #13

Updated by Nicolas CHARLES about 4 years ago

  • Status changed from Pending technical review to Pending release
Actions #14

Updated by François ARMAND almost 4 years ago

  • Tracker changed from Bug to Architecture
  • Priority deleted (0)
Actions #15

Updated by Vincent MEMBRÉ almost 4 years ago

This bug has been fixed in Rudder 6.1.0~beta1 which was released today.

Actions #16

Updated by Vincent MEMBRÉ almost 4 years ago

  • Related to Bug #17215: create migration script for LDAP indexes added
Actions #17

Updated by Vincent MEMBRÉ almost 4 years ago

  • Status changed from Pending release to Released
Actions #18

Updated by François ARMAND almost 4 years ago

  • Fix check changed from To do to Checked
Actions

Also available in: Atom PDF