Open
Conversation
8ec7c9b to
06e5431
Compare
mrl5
commented
Jan 10, 2026
dba365a to
808f411
Compare
808f411 to
f6cad49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #18
overview
capacityparampingoo.ymlinterfacerules: rate_limit_api_routes: expression: http_request.path.starts_with("/api/") actions: + - action: limit + limit: + max: 10 + period: 60 # in seconds + capacity: 1024 # number of IPs that can be trackedbenchmark
Implementation was tested with
pong.rsservice compiled with--releaseprofile. CPU used was AMD Ryzen 7 3700X 8-Core Processor (16 threads)TL;DR
Rate limiter introduces ~6.83 us of latency (133.55us - 126.72us)
bench 1 -- allow all requests but count
wrk -H "User-Agent: curl/8.4.0" -H "Accept: */*" -c10 -t4 -d30s --latency http://127.0.0.1:8080/foobench 2 -- rate limit all requests
wrk -H "User-Agent: curl/8.4.0" -H "Accept: */*" -c10 -t4 -d30s --latency http://127.0.0.1:8080/fooreference 1 -- upstream pingoo (commit 2716047) + pong
wrk -H "User-Agent: curl/8.4.0" -H "Accept: */*" -c10 -t4 -d30s --latency http://127.0.0.1:8080/fooreference 2 -- this PR + pong, rate limiting disabled
wrk -H "User-Agent: curl/8.4.0" -H "Accept: */*" -c10 -t4 -d30s --latency http://127.0.0.1:8080/fooreference 3 -- just pong
wrk -H "User-Agent: curl/8.4.0" -H "Accept: */*" -c10 -t4 -d30s --latency http://127.0.0.1:3000/foobench disclaimer
for the record
bench 1 -- allow all requests but countrequired this modification, so it was kind of custom build: