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

Implement server side connection limit #1550

Merged
merged 2 commits into from
Jun 5, 2024
Merged

Implement server side connection limit #1550

merged 2 commits into from
Jun 5, 2024

Conversation

jbearer
Copy link
Member

@jbearer jbearer commented Jun 4, 2024

This change implements a configurable limit on the number of simultaneous HTTP connections allowed by a query server. This should allow us to efficiently filter out requests during periods of high load so that the burden is pushed back onto clients, and the server continues operating within normal limits. This in turn will allow us to turn off or scale back the AWS rate limiter.

This PR:

  • Uses the RateLimitListener from the new version of tide disco to limit server load to a configurable number of requests

This PR does not:

  • Rate limit based on client IPs. Rate limiting is first come first served, so we will still need an intelligent, external layer to prevent malicious behavior and DDoS attacks. But the parameters of this external rate limiter can be tuned to handle deliberate attacks only, while heavy load due to normal circumstances should be adequately handled by the server
  • Limit connections open by WebSockets. The limit only applies to HTTP connections

Key places to review:

  • sequencer/src/api/options.rs

Things tested

Set up local demo to use a fairly aggressive limit of 25 simultaneous requests. Ran just demo-native and the logs of the load generators, nasty-client, and sequencers were all happy.

jbearer added 2 commits June 5, 2024 13:47
This change implements a configurable limit on the number of simultaneous
HTTP connections allowed by a query server. This should allow us to
efficiently filter out requests during periods of high load so that
the burden is pushed back onto clients, and the server continues
operating within normal limits. This in turn will allow us to turn off
or scale back the AWS rate limiter.
@jbearer jbearer force-pushed the jb/connection-limit branch from 186e2a4 to 6bd378e Compare June 5, 2024 17:48
@jbearer jbearer merged commit 8811fc8 into main Jun 5, 2024
15 checks passed
@jbearer jbearer deleted the jb/connection-limit branch June 5, 2024 18:37
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.

2 participants