Skip to content

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

@thebongy

Description

@thebongy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions