Discourse中的全局速率限制

您好,

我们已将 Discourse 升级到 2.2.5 版本。
这涉及每位用户每天发帖数量的限制问题。

我们的默认设置如下:
DISCOURSE_MAX_REQS_PER_IP_PER_MINUTE:每分钟每个 IP 的请求数(默认为 200)
DISCOURSE_MAX_REQS_PER_IP_PER_10_SECONDS:每 10 秒每个 IP 的请求数(默认为 50)

我们希望将其增加至:
DISCOURSE_MAX_REQS_PER_IP_PER_MINUTE:1000
DISCOURSE_MAX_REQS_PER_IP_PER_10_SECONDS:500

您认为这对 Discourse 服务器和性能会有影响吗?
因为一些用户开始抱怨他们达到了发帖数量的限制。

谢谢

I do not think this is the rate limit being discussed. Provide screenshots of the limiter being hit please or get more details.

It sounds like your users are running into first day user post count limits is my guess.

User gets error like:

01:09:42 {"errors":["You’ve performed this action too many times. Please wait 19 seconds before trying again."],"error_type":"rate_limit","extras":{"wait_seconds":19}}

That is indeed the Nginx per-IP rate limits, are you sure you are not behind a reverse proxy which is incorrectly sending all client IP addresses as the same IP address?

Is it always the same users? Are they trying to use the API?

If it’s not and they aren’t then check the profiles of some affected users, do their IPs look accurate? Are they all the same or similar? If so it’s either a misconfigured reverse proxy or something like Cloudflare being used with the orange cloud enabled without the template specified in the YML.

Yes they are using the same user, to generate a lot of posts per minute (via user API key).
But they now complain they are limited in terms of number of posts allowed for that user.

Do you think it could help if I increase:
DISCOURSE_MAX_REQS_PER_IP_PER_MINUTE : 1000
DISCOURSE_MAX_REQS_PER_IP_PER_10_SECONDS : 500

1 个赞

我遇到了同样的问题。我想使用 API,但它出现了这样一个错误:


我希望能够为管理员设置特定 API 的速率限制。
我不知道如何修改全局速率限制。
如果您能告诉我它在哪里,我将不胜感激。
我来自中国,所以我的英语不好,非常抱歉。

我们仅设有统一的 API 速率限制,无法针对特定路由自定义限制。

您正在寻找的限制位于站点设置中:

  • 创建主题的速度限制
  • 创建帖子的速度限制
  • 新用户创建主题的速度限制
  • 新用户创建帖子的速度限制

请访问 https://discourse.example.com/admin/site_settings/category/rate_limits?filter=create 以修改这些设置。

2 个赞