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

Ratelimits seem harsher as of v1.3.7 #610

Open
Half-Shot opened this issue Aug 28, 2024 · 2 comments
Open

Ratelimits seem harsher as of v1.3.7 #610

Half-Shot opened this issue Aug 28, 2024 · 2 comments

Comments

@Half-Shot
Copy link
Contributor

I'm finding that as a single user on my homeserver, many media requests are being ratelimited whereas previously I wouldn't find it noticeable. I know that the leaky buckets were added in recently, and I've set some reasonably high limits but I'm still seeing quite a few medias fail to load.

How can I help debug this?

# Controls for the rate limit functionality
rateLimit:
  # Set this to false if rate limiting is handled at a higher level or you don't want it enabled.
  enabled: true

  # The number of requests per second before an IP will be rate limited. Must be a whole number.
  requestsPerSecond: 5

  # The number of requests an IP can send at once before the rate limit is actually considered.
  burst: 10

  buckets:
    # The download bucket applies to both download requests and thumbnail requests. Each anonymous
    # user is assigned a single bucket from their IP address. Authenticated requests (when supported)
    # will use the authenticated entity as the subject - either a user or remote server.
    downloads:
      # The maximum size of each bucket.
      capacityBytes: 1048576000 # 300mb default
      # The number of bytes to "drain" from the bucket every minute.
      drainBytesPerMinute: 52428800 # 5mb default
      # The number of bytes a requester can go over the capacity, once. This is used to give some
      # buffer to allow a single file to be downloaded when the caller is near the limit. This
      # should be set to either your max remote download size or 30% of the capacityBytes, whichever
      # is smaller.
      overflowLimitBytes: 104857600 # 100mb default
@turt2live
Copy link
Member

The logs should indicate what kind of rate limit is being hit, and include some details as to where in the code it thinks it's happening.

Snippets, possibly with debug logging enabled, from a failed request would help.

@Candinya
Copy link

Candinya commented Sep 6, 2024

If you mean errors like Replying with result: *_responses.ErrorResponse &{Code:M_LIMIT_EXCEEDED Message:Rate Limited InternalCode:M_LIMIT_EXCEEDED}, our service seem to fix this issue after setting up signing key (refer to config.sample.yaml#L109 ), it might be remote server's rate limit policy rather than MMR's configuration error.

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

No branches or pull requests

3 participants