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

server/comms: add new routes to limiter #1288

Merged
merged 2 commits into from Nov 24, 2021
Merged

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Nov 12, 2021

Add the newish price feed, spots, and candles to the routeLimiter.
The "info" limiter includes the spots and candles routes.
A new shared limiter for subscription routes is created for the order_book and the new price_feed routes.
Add the connect route with its own rates. Burst is still 100. Clients should self limit during account discover, as we do.

Add the newish price feed, spots, and candles to the routeLimiter.
The "info" limiter includes the spots and candles routes.
A new shared limiter for subscription routes is created for the
order_book and the new price_feed routes.
Add the connect route with its own rates. Burst is still 100. Clients
should self limit during account discover, as we do.
@chappjc chappjc added this to the 0.4 milestone Nov 17, 2021
@chappjc chappjc marked this pull request as ready for review November 17, 2021 18:07
wsRateRegister, wsBurstRegister = 1 / 60.0, 1 // register, rate.Every(time.Minute) but const
wsRateConnect, wsBurstConnect = 4, 100 // connect, account discovery requires bursts - (*Core).discoverAccount
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't the extra connections just use some of the burst tokens? A constant rate of 4 connections per second seems really high. What would be the harm in going lower, maybe 1 / 10.0 ?

In general, these rates seem pretty permissive.

Copy link
Member Author

@chappjc chappjc Nov 18, 2021

Choose a reason for hiding this comment

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

That's a good point re the connect route. I agree.
I've tried to be cautious about the limits so we don't dos people too easily, but this one in particular really has no good case for sustained 4 per second. Will update.

@chappjc chappjc merged commit 132b16f into decred:master Nov 24, 2021
@chappjc chappjc deleted the connect-limit branch November 24, 2021 15:53
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.

None yet

2 participants