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

auth cache / singleflight improvements #462

Open
1 of 2 tasks
tzarebczan opened this issue Oct 31, 2022 · 0 comments
Open
1 of 2 tasks

auth cache / singleflight improvements #462

tzarebczan opened this issue Oct 31, 2022 · 0 comments
Labels
consider soon Discuss this issue at the next planning meeting, then remove this label

Comments

@tzarebczan
Copy link
Contributor

tzarebczan commented Oct 31, 2022

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

@tzarebczan tzarebczan added the consider soon Discuss this issue at the next planning meeting, then remove this label label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consider soon Discuss this issue at the next planning meeting, then remove this label
Projects
None yet
Development

No branches or pull requests

1 participant