Rate limit requests per logged-in user or logged-out IP

Description

Add Rack::Attack for rate limiting. The gem allows the common use case of IP-based throttling, but it can also work with Devise users.

The "limit" and "period" options should be configurable through ArchiveConfig.

How to test: Use a tool like siege and hammer the staging site. Expect some speed bumps.

Activity

Show:
Sarken
September 14, 2019, 6:44 AM

I’m going to very presumptuously assign this to Elz because she has a branch:

Sarken
October 11, 2019, 5:17 AM
Sarken
October 11, 2019, 7:06 AM

I made 350 requests to the /works page using cURL and toward the end it started giving me 429 instead of 200 responses, so this looks good!

james_
October 19, 2019, 10:03 PM

I need to have two goes to get hit however all is good.

 

HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 200 OK
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests
HTTP/1.1 429 Too Many Requests

 

james_
October 28, 2019, 5:39 PM

To be clear I was happy with this. I think that is two of us.

DeployedToBeta

Assignee

Elz J

Reporter

redsummernight

Roadmap

Misc
Visitors

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9
Configure