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

Slack Rate Limit Prevention #66

Open
ananyo141 opened this issue Nov 7, 2024 · 1 comment
Open

Slack Rate Limit Prevention #66

ananyo141 opened this issue Nov 7, 2024 · 1 comment
Assignees

Comments

@ananyo141
Copy link
Contributor

ananyo141 commented Nov 7, 2024

We have to proactively think about scenarios in the future where the application can reach the threshold of Slack's Fair Usage Policy (see the docs on rate limiting). As per testing, it is around 150 on local non-premium workspace. But there would be exponential backoff (less - around 90 on second time without cooloff once rate limit is hit)

Slack recommends a 1 request per second policy for best results. So the obvious solution can be to throttle requests to hit the API once every second, but there might be other ways to handle this. One caveat: the default frappe long worker has a hard limit of 25 minutes to run, so according to this 1500 requests is the limit.

After discussion with @niraj2477, we can have a combination of Job Batching + Cooloff + Failure Correction (task retry after cooldown period) to tackle the rate limiting, to dynamically handle and retry api calls upon rate limit.

NOTE: We are using throttling as of now (1 request/second)

@dhsathiya
Copy link
Member

@ananyo141 Please check other open source Slack apps if they are using some other API endpoints or methods for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants