Skip to content

Make rate limits less aggressive#11677

Merged
mekarpeles merged 2 commits intomasterfrom
tweak-nginx-thresholds
Jan 7, 2026
Merged

Make rate limits less aggressive#11677
mekarpeles merged 2 commits intomasterfrom
tweak-nginx-thresholds

Conversation

@cdrini
Copy link
Copy Markdown
Collaborator

@cdrini cdrini commented Jan 7, 2026

In response to #11611

Technical

Testing

Screenshot

Stakeholders

Copilot AI review requested due to automatic review settings January 7, 2026 20:53
@cdrini cdrini added the Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle. label Jan 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reduces the aggressiveness of rate limits in response to issue #11611 by restructuring the nginx rate limiting logic and increasing the global crawler rate limit threshold.

  • Increases the global non-identifying crawler rate limit from 17r/s to 20r/s
  • Refactors referer checking logic by renaming variables for clarity and splitting path patterns into strict requirements vs. probable requirements
  • Moves certain paths (subjects, authors, search) from strict referer requirements to a new "probably requires referer" category

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docker/web_nginx.conf Renames nginx map variables (is_empty_refererno_referer, is_logged_outlogged_out), removes the combined is_sus_referer map, and creates new probably_requires_referer map with a subset of previously restricted paths
docker/nginx.conf Increases the rate limit for non-identifying crawlers from 17r/s to 20r/s

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to 42
map $request_uri $probably_requires_referer {
"~*^/subjects/" 1;
"~*^/authors/OL" 1;
"~*^/search\?" 1;
}
Copy link

Copilot AI Jan 7, 2026

Choose a reason for hiding this comment

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

The new map probably_requires_referer is missing a default value. Unlike the other maps which explicitly set default 0;, this map will return an empty string for non-matching URIs instead of 0. While this may work depending on how it's used in the external tagger.js, it's inconsistent with the patterns established in the other map definitions (requires_referer, no_referer, logged_out, is_sus_user_agent, etc.) which all explicitly define their default values.

Copilot uses AI. Check for mistakes.
@mekarpeles mekarpeles merged commit 5f627b7 into master Jan 7, 2026
8 checks passed
@cdrini cdrini deleted the tweak-nginx-thresholds branch January 8, 2026 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Patch Deployed This PR has been deployed to production independently, outside of the regular deploy cycle.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants