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

document max_concurrency #1621

Merged
merged 2 commits into from Oct 26, 2020
Merged

document max_concurrency #1621

merged 2 commits into from Oct 26, 2020

Conversation

ghost
Copy link

@ghost ghost commented May 13, 2020

this documents max_concurrency field included in session start limit

| total | integer | The total number of session starts the current user is allowed |
| remaining | integer | The remaining number of session starts the current user is allowed |
| reset_after | integer | The number of milliseconds after which the limit resets |
| max_concurrency | integer | The number of identify requests allowed per 5 seconds |
Copy link
Contributor

@jhgg jhgg May 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't capture the nuance though. Because really it's based on the shard rate_limit_key = shard_id % max_concurrency

So, if you had a max concurrency of 16, and 16 shards for example, you could start them all up at the same time.

Whereas if you had 32 shards, if you tried to start up shard 0 and 16 at the same time for example, it would not work. You can start shards 0-15 concurrently, then 16-31...

shard_id: 0, rate limit key (0 % 16): 0
shard_id: 1, rate limit key (1 % 16): 1
shard_id: 2, rate limit key (2 % 16): 2
shard_id: 3, rate limit key (3 % 16): 3
shard_id: 4, rate limit key (4 % 16): 4
shard_id: 5, rate limit key (5 % 16): 5
shard_id: 6, rate limit key (6 % 16): 6
shard_id: 7, rate limit key (7 % 16): 7
shard_id: 8, rate limit key (8 % 16): 8
shard_id: 9, rate limit key (9 % 16): 9
shard_id: 10, rate limit key (10 % 16): 10
shard_id: 11, rate limit key (11 % 16): 11
shard_id: 12, rate limit key (12 % 16): 12
shard_id: 13, rate limit key (13 % 16): 13
shard_id: 14, rate limit key (14 % 16): 14
shard_id: 15, rate limit key (15 % 16): 15
shard_id: 16, rate limit key (16 % 16): 0
shard_id: 17, rate limit key (17 % 16): 1
shard_id: 18, rate limit key (18 % 16): 2
shard_id: 19, rate limit key (19 % 16): 3
shard_id: 20, rate limit key (20 % 16): 4
shard_id: 21, rate limit key (21 % 16): 5
shard_id: 22, rate limit key (22 % 16): 6
shard_id: 23, rate limit key (23 % 16): 7
shard_id: 24, rate limit key (24 % 16): 8
shard_id: 25, rate limit key (25 % 16): 9
shard_id: 26, rate limit key (26 % 16): 10
shard_id: 27, rate limit key (27 % 16): 11
shard_id: 28, rate limit key (28 % 16): 12
shard_id: 29, rate limit key (29 % 16): 13
shard_id: 30, rate limit key (30 % 16): 14
shard_id: 31, rate limit key (31 % 16): 15

@ghost
Copy link

ghost commented May 26, 2020

Wait, so the limit isn't just one every five seconds? Is this new behaviour?

@MinnDevelopment
Copy link
Contributor

Is this new behaviour?

No, this has been a feature for years. They just now added a field which allows us to find out which concurrency limit a bot is eligible for. Only large bot owners are eligible, so this feature was rather niche and unknown until now.

@ghost
Copy link

ghost commented May 26, 2020

@MinnDevelopment cheers for clarifying

@msciotti
Copy link
Contributor

I'll add Jake's notes in this PR: #2165

@msciotti msciotti merged commit 2f87769 into discord:master Oct 26, 2020
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

Successfully merging this pull request may close these issues.

3 participants