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

Impact of hashes comparisons in the Elasticsearch reconciliation performance #6076

Closed
barkbay opened this issue Oct 10, 2022 · 0 comments · Fixed by #6080
Closed

Impact of hashes comparisons in the Elasticsearch reconciliation performance #6076

barkbay opened this issue Oct 10, 2022 · 0 comments · Fixed by #6080
Assignees
Labels
>enhancement Enhancement of existing functionality

Comments

@barkbay
Copy link
Contributor

barkbay commented Oct 10, 2022

For each reconciliation the operator systematically performs some bcrypt operations to ensure Elasticsearch users passwords hashes are up-to-date in the file realm. These cryptographic operations can have a significant impact in cpu constrained environments:

image

The use of bcrypt.CompareHashAndPassword is linearly proportional to the number of users managed in the file realm. I think there are 3 of them by default (not counting the ones generated for some associations). Using a LRU cache like github.com/hashicorp/golang-lru can significantly improve the situation:

image

(in the example above I added the LRU cache and a couple of additional spans)

The question is to find a good cache size, it can be the max-concurrent-reconciles value (with a multiplier?) or inferred from the available memory (a bit involved maybe).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant