Skip to content

Configurable rate limit in DHT server - #514

Open
WeirdCarrotMonster wants to merge 1 commit into
bitmagnet-io:mainfrom
WeirdCarrotMonster:feature/configurable-rate-limit
Open

Configurable rate limit in DHT server#514
WeirdCarrotMonster wants to merge 1 commit into
bitmagnet-io:mainfrom
WeirdCarrotMonster:feature/configurable-rate-limit

Conversation

@WeirdCarrotMonster

Copy link
Copy Markdown

While trying to figure out why my instance suddenly stopped finding new torrents, i've noticed many KRPC error 201: too many requests logs. While this wasn't a source of my problem, i found out that there's no actual way to increase the limit of requests from a single IP.

This PR adds config options for that. Old hard-coded values are moved to defaults.

+---------------------------------------------+---------------------------+-------------------------+-------------------------+---------+
| dht_server.rate_limit:                      | server.RateLimitConfig    |                         |                         |         |
+---------------------------------------------+---------------------------+-------------------------+-------------------------+---------+
| dht_server.rate_limit.burst                 | int                       | 100                     | 4                       | env     |
| dht_server.rate_limit.size                  | int                       | 1000                    | 1000                    | default |
| dht_server.rate_limit.ttl                   | time.Duration             | 20s                     | 20s                     | default |
| dht_server.rate_limit.window_size           | time.Duration             | 1s                      | 1s                      | default |
+---------------------------------------------+---------------------------+-------------------------+-------------------------+---------+

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.

1 participant