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

Amount of time taken to login is proportional to the number of authorized usernames #3

Open
thebongy opened this issue May 29, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@thebongy
Copy link
Contributor

Currently, the get_keys script has a very naive implementation:
It loops through the usernames in the server_id/username and sequentially makes a request for each username

This is bad because the amount of time taken to login becomes proportional to the no of users in that file.

Possible solutions may be

  • Storing a cached file of keys in /tmp and then retrieving those keys if the users file hasn't changed. (Or maybe if it has changed, request only new user's keys). Can be implemented by using diff to compare if the usernames file changed. (Though we have to deal with issues like cache invalidation (what happens if a user adds a new key to his account?))
  • An optimization that can be made is to request the keys in parallel, instead of sequentially. Should reduce times considerably.

Open to more suggestions, welcoming PRs

@thebongy thebongy added enhancement New feature or request help wanted Extra attention is needed labels May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant