Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optimize replication information retrieval scope for improved performance #24

Merged
merged 1 commit into from
Jan 1, 2025

Conversation

wadahiro
Copy link

Currently, sub scope was used for replication information, which fetched all entries under the base DN. I changed it to base to retrieve information only from the base DN itself. This change improves performance by limiting the scope of the query.

In my case, it took 0m0.069s for the search using sub scope.

$ time ldapsearch -x -h ldap.example.com -D "cn=manager,dc=example,dc=com" -W -b "dc=example,dc=com" -s sub  "contextCSN=*" contextCSN
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope baseObject
# filter: contextCSN=*
# requesting: contextCSN
#

# example.com
dn: dc=example,dc=com,
contextCSN: 20241227004734.408350Z#000000#000#000000

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

real    0m0.069s
user    0m0.005s
sys     0m0.000s

It took 0m0.006s for the search using base scope.

$ time ldapsearch -x -h ldap.example.com -D "cn=manager,dc=example,dc=com" -W -b "dc=example,dc=com" -s base  "contextCSN=*" contextCSN
# extended LDIF
#
# LDAPv3
# base <dc=example,dc=com> with scope baseObject
# filter: contextCSN=*
# requesting: contextCSN
#

# example.com
dn: dc=example,dc=com,
contextCSN: 20241227004734.408350Z#000000#000#000000

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

real    0m0.006s
user    0m0.005s
sys     0m0.000s

…ance

Modified the scope of replication information retrieval.
Previously, sub scope was used, which fetched all entries under the base DN.
Changed it to base to retrieve information only from the base DN itself.
This change improves performance by limiting the scope of the query.
@fritterhoff fritterhoff changed the title Optimize replication information retrieval scope for improved performance feat: optimize replication information retrieval scope for improved performance Jan 1, 2025
@fritterhoff
Copy link
Member

LGTM. We never noticed this bug since we limited the access for our monitoring user to the base entity only.

@fritterhoff fritterhoff enabled auto-merge January 1, 2025 14:33
@fritterhoff fritterhoff added this pull request to the merge queue Jan 1, 2025
Merged via the queue into hm-edu:main with commit bb0b956 Jan 1, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants