Skip to content

auth cache / singleflight improvements #462

@tzarebczan

Description

@tzarebczan

We're still seeing some concurrent load issues when lots of users come onto the site concurrently, and it happens in waves when the tokens are re-validated.

  • make sure to single flight has verified_email across all calls to odysee-apis. I.e. when a user loads odysee, 10 calls might be made that require verified email - only 1 should hit internal apis, the rest would wait for that response, and the process the other 9 calls with the cached data.

  • spread out the waves. This can be done by adding a different validity period for different users, which helps spread the 2nd wave/third/etc waves. Similarly done in livestreamer: https://github.com/OdyseeTeam/livestreamer/blob/a9c54cb63c324ab4b2dd965c9325d38a334869f3/odysee/sdk/sdk.go#L73

Metadata

Metadata

Assignees

No one assigned

    Labels

    consider soonDiscuss this issue at the next planning meeting, then remove this label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions