mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #1337] [BUG] OPAQUE password verification potentially blocks async runtime during bind operations #467
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#467
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @PerArneng on GitHub (Oct 24, 2025).
Original GitHub issue: https://github.com/lldap/lldap/issues/1337
Describe the bug
When doing bind in LoginHandler the
password_matchfunction uses the opaque cryptographic algorithm which seems to be very CPU bound. From what it seems it looks like it should be put in a spawn_blocking function not to block the async thread pool.To Reproduce
It's a performance issue so you would need to run benchmarks and compare. I'ts hard to reproduce, because it's just there.
Expected behavior
Faster performance when doing bind with multiple parallel requests.
Logs
N/A
Additional context
We had some performance issues with lldap and a 3rd party system that acted crazy, and did some research and we found that the OPAQUE method was used and it seemed very CPU hungry and reading about it on lldap GitHub page as well, it seemed like that was a fact.
It's even more visible if the core count is low ex if you run in a Kubernetes environment and set limits or have low core count nodes. One of our third party systems started to spam lldap with lots of bind's on each normal request instead of reusing sessions (crazy, I know) . But that led us to investigate. In an normal scenario you might not see this issue so often but putting it out of the async thread pool when executing OPAQUE might give a bit of performance boost when dealing with multiple requests.
Disclaimer: Im pretty novice when it comes to async rust runtimes low level stuff so I could be mistaken here but then please just close the bug.
@nitnelave commented on GitHub (Oct 24, 2025):
Would it be simpler to increase the number of worker threads? Maybe something like num CPU would work. It sounds like it would take advantage of the most parallelization, while adding little complexity and memory overhead, especially for smaller systems (e.g. raspberry pi)
@PerArneng commented on GitHub (Oct 24, 2025):
It could be that it helps by increasing worker threads. Is there an option for that?
The code for doing spawn_blocking would look something like this:
This github issue got id 1337 🤓🎊
@nitnelave commented on GitHub (Oct 25, 2025):
You can try changing the code locally in server/src/main.rs where we set the number of workers. Currently it's not configurable, but making it equal to num_threads makes sense, I think
@PerArneng commented on GitHub (Oct 25, 2025):
Thanks, will try that and see if it has any effect 🤩