# Clarification of Rate Limits

**URL:** <https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418>\
**Category:** Chat and IRC\
**Created:** [September 7, 2021, 9:40am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418 "2021-09-07T09:40:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aoleynik](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/aoleynik/32/5907_2.png) [@aoleynik](https://discuss.dev.twitch.com/u/aoleynik)\
**Post date:** [September 7, 2021, 9:40am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/1 "2021-09-07T09:40:21Z")

</div>

As it said in [Rare Limits](https://dev.twitch.tv/docs/irc/guide#rate-limits) section of user guide: a developer is allowed to send a certain number of commands to the server per second.  
Is this restriction relates to one WebSocket connection to the server or number of commands counted in all developer’s connections?

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [September 7, 2021, 6:10pm UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/2 "2021-09-07T18:10:48Z")

</div>

The rate limit is per user. So if you have a bot called `BotX`, all connections by that bot will share the same rate limit. If you also have a `BotY`, that bot will have its own rate limits separate from `BotX`

---

<div class="post-metadata">

**Author:** ![aoleynik](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/aoleynik/32/5907_2.png) [@aoleynik](https://discuss.dev.twitch.com/u/aoleynik)\
**Post date:** [September 10, 2021, 8:07am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/3 "2021-09-10T08:07:28Z")

</div>

Does Twitch has limits on number of channels per connection? Is there a rule of thumb for this number?

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [September 10, 2021, 9:17am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/4 "2021-09-10T09:17:00Z")

</div>

The limit is how many messages your client can handle before the message buffer fills, at which point Twitch will just kill the connection.

So if you’re in some of the most active channels on Twitch then you’ll be able to join fewer channels per connection than if most of the channels were idle, or active at different times of day.

If you want to really get the most out of each connection you could track usage and balance channels over connections but that’s really overkill, most devs just use limits between 50 to 200 channels per connection depending on the specific needs/capabilities of the bot.

---

<div class="post-metadata">

**Author:** ![aoleynik](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/aoleynik/32/5907_2.png) [@aoleynik](https://discuss.dev.twitch.com/u/aoleynik)\
**Post date:** [September 10, 2021, 10:54am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/5 "2021-09-10T10:54:03Z")

</div>

Is there are any other reasons Twitch could close connection than exhausted buffers and rate limits?

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [September 10, 2021, 10:58am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/6 "2021-09-10T10:58:37Z")

</div>

Failure to ping/pong would also cause the connection to be dropped.

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [October 10, 2021, 10:59am UTC](https://discuss.dev.twitch.com/t/clarification-of-rate-limits/33418/7 "2021-10-10T10:59:38Z")

</div>

Closed on October 10, 2021, 10:59am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
