Add throttling info to README (#223)

James Kiesel committed Nov 26, 2016
commit 06938bfd357c0d8749046fc4aeaf31cd6d6e67b5
Showing 1 changed file with 17 additions and 0 deletions
README.md +17 -0
@@ @@ -510,6 +510,23 @@ module Ahoy
end
```
+ ### Request Throttling
+
+ By default, Ahoy uses [rack-attack](https://github.com/kickstarter/rack-attack) to throttle requests. To turn this off, modify the `throttle` flag on the Ahoy object.
+
+ ```ruby
+ # only throttle ahoy requests in production
+ Ahoy.throttle = ENV['RACK_ENV'] == 'production'
+ ```
+
+ The default throttle is 20 requests per minute. This can be overridden using the `throttle_limit` and `throttle_period` options.
+
+ ```ruby
+ # limit number of requests to 100 requests every 5 minutes
+ Ahoy.throttle_limit = 100
+ Ahoy.throttle_period = 5.minutes
+ ```
+
## Native Apps
### Visits