Skip to content

Commit 627c5e0

Browse files
rochdavidgisbey
authored andcommitted
Increasing rate limit for API user
In order to do some load testing on the infrastructure we want to disable the rate limiting that is applied within the app. Increasing the value to 10 millions request per min allow us to effectively bypass the rate limiter with minimal change to the code.
1 parent 7f99fb9 commit 627c5e0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

config/initializers/rack_attack.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
class Rack::Attack
99
CONVERSATION_API_PATH_REGEX = /^\/api\/v\d+\/conversation/
1010

11-
throttle(Api::RateLimit::GOVUK_API_USER_READ_THROTTLE_NAME, limit: 10_800, period: 1.minute) do |request|
11+
throttle(Api::RateLimit::GOVUK_API_USER_READ_THROTTLE_NAME, limit: 10_000_000, period: 1.minute) do |request|
1212
if request.path.match?(CONVERSATION_API_PATH_REGEX) && read_method?(request)
1313
signon_uid(request)
1414
end
1515
end
1616

17-
throttle(Api::RateLimit::GOVUK_API_USER_WRITE_THROTTLE_NAME, limit: 900, period: 1.minute) do |request|
17+
throttle(Api::RateLimit::GOVUK_API_USER_WRITE_THROTTLE_NAME, limit: 10_000_000, period: 1.minute) do |request|
1818
if request.path.match?(CONVERSATION_API_PATH_REGEX) && !read_method?(request)
1919
signon_uid(request)
2020
end

0 commit comments

Comments
 (0)