Sync: chunk user requests#1367
Merged
Merged
Conversation
The site can't handle huge syncs. Even a bulk patch of 10k users will crash the service. Chunk the requests into groups of 1000 users and await them sequentially. Testing showed that concurrent requests are not scalable and would also crash the service.
jb3
approved these changes
Jan 19, 2021
Member
jb3
left a comment
There was a problem hiding this comment.
Looks good, a similar solution has already been tested in the production cluster and proven to work so this should fix our timeout problems.
Den4200
approved these changes
Jan 19, 2021
Member
Den4200
left a comment
There was a problem hiding this comment.
Was lurking in #dev-ops and tested in the test server!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The site can't handle huge syncs. Even a bulk patch of 10k users will crash the service. Chunk the requests into groups of 1000 users and await them sequentially. Testing showed that concurrent requests are not scalable and would also crash the service.
10k user patch without chunking. This caused the site service to crash and respond with 524.
10k user patch with chunking and concurrent requests. The operation succeeded but there was some CPU throttling. It implies that this won't scale well (the situation that triggered the discovery of this issue was a sync of over 80k users).
This compares the two aforementioned tests (start times indicates by the vertical lines):
I have no graphs for chunking without concurrent requests (i.e. what this PR does) but we know that this approach works as it was done in production with internal evals too.