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

Add throttling logic for createDoc, getDeltas, and connectDoc to provide per-cluster rate-limiting at the HTTP route level #13896

Merged

Conversation

tianzhu007
Copy link
Contributor

@tianzhu007 tianzhu007 commented Jan 30, 2023

To better protect the AFR service from crashing due to high counts of creating document requests, it has been proposed that we rate limit the “create document”, "get deltas" API route, and "connect document" socket at a per-cluster level. We also extend the existing throttling logic to provide per-cluster rate-limiting at the HTTP route level.

@tianzhu007 tianzhu007 requested a review from a team as a code owner January 30, 2023 23:55
@github-actions github-actions bot added area: server Server related issues (routerlicious) base: main PRs targeted against main branch labels Jan 30, 2023
@yangg-msft
Copy link
Contributor

Is it intentional not to throttle connect doc?

@tianzhu007 tianzhu007 closed this Feb 7, 2023
@tianzhu007 tianzhu007 reopened this Feb 7, 2023
@tianzhu007
Copy link
Contributor Author

tianzhu007 commented Feb 7, 2023

Is it intentional not to throttle connect doc?

The connect doc is via web socket, and we add the throttling connect doc in the server/routerlicious/packages/lambdas/src/alfred/index.ts

https://github.com/microsoft/FluidFramework/blob/1b51ee78a66a9825132f20294e9daf67e844f773/server/routerlicious/packages/lambdas/src/alfred/index.ts#:~:text=const%20throttleErrorPerCluster%20%3D,%7D

# Conflicts:
#	server/routerlicious/lerna-package-lock.json
#	server/routerlicious/package-lock.json
Copy link
Contributor

@yangg-msft yangg-msft left a comment

Choose a reason for hiding this comment

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

:shipit:

# Conflicts:
#	server/routerlicious/packages/lambdas/src/alfred/index.ts
#	server/routerlicious/packages/routerlicious-base/src/alfred/runner.ts
#	server/routerlicious/packages/routerlicious-base/src/test/alfred/io.spec.ts
@tianzhu007 tianzhu007 merged commit f38f7de into microsoft:main Feb 9, 2023
@tianzhu007 tianzhu007 changed the title Add throttling logic for creating documents to provide per-cluster rate-limiting at the HTTP route level Add throttling logic for createDoc, getDeltas, and connectDoc to provide per-cluster rate-limiting at the HTTP route level Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: server Server related issues (routerlicious) base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants