Sendbird applications are rate-limited to ensure the best experience for all users. The rate limits vary depending on your plan’s allowed quota of monthly active users.Thus, the customer should abide carefully by their own rate limits. If you overlook this, you might encounter the error below.
Too many requests (scope: app, limit: 10;w=1, remaining: 0, retry_after: 0.069786548614502s, reset: 0.96978664398193s
- Your rate limit is decided based on your contract plan. You can validate your rate limit in each HTTP request.
- There are other stricter limits, which are applied on your applications regardless of your plan.
SDK methods call:
- An SDK function call can be regarded as a single limit of one user. This is because an SDK connection can be made once the user has been authenticated through WebSocket connection. Moreover, rate limits for SDK methods can be applied to all the customers regardless of their plans.
- To prevent abnormal user activity, we limit the number of messages per second to the channels with smart throttling by default(link). For example, if a user sends 10 messages to the channel at once(within one second), 5 out of 10 messages will be rate-limited. If 10 users send one message to the same channel at once (within one sec), 5 out of 10 messages will not be displayed in the chat, because we support smart throttling(link) for the channel.
Refer to the following best practices for rate limits.
- Delay each call request and retry to call based on the error message below when you have already hit the rate limit. It’s generally common to build three to five retry attempts.
Too many requests (scope: channel, limit: 10;w=1, remaining: 0, retry_after: 0.069786548614502s, reset: 0.96978664398193s)
- Optimize your code to eliminate unnecessary API/SDK calls, such as listing and looping through each instance.
- Avoid using a shared user. This will cause multiple concurrent requests.