- Fix Token bucket to respect custom cost
- Fix regression to support other backends
- Fix type specs for ETS backends
- Adds Atomic backends and possible algorithms
- Added
:algorithm
option to the Atomic backend with support for::fix_window
(default) - Fixed time window rate limiting:leaky_bucket
- Constant rate limiting with burst capacity:token_bucket
- Token-based rate limiting with burst capacity
- Add benchmarks file and run them with
bench
- Improved API a little more. Should be compatibe with previous RC
- Made ETS backend more flexible with
:algorithm
option - Added
:key_older_than
option to the ETS backend
- Made ETS backend more flexible with
- Added
:algorithm
option to the ETS backend with support for::fix_window
(default) - Fixed time window rate limiting:sliding_window
- Sliding time window for smoother rate limiting:leaky_bucket
- Constant rate limiting with burst capacity:token_bucket
- Token-based rate limiting with burst capacity
- Breaking change. Completely new API. Consider upgrading if you are experiencing performance or usability problems with Hammer v6. See [./guides/upgrade-v7.md] for upgrade instructions. #104
- Hammer.Plug has been removed. See documentation for using Hammer as a plug in Phoenix.
- Fix issue in OTP 26 and Elixir 1.15 by not using to_existing_atom in configuration
- Ensure Elixir version is ~> 1.13 #79.
- Updgrade dependency packages
- Merged #41 resulting in ETC without GenServer (and therefore better performance)
- Merged #46 remove additional whitespace
- Updated Docs based on #45
- Adds CREDITS.md
- Change the
ETS
backend to throw an error if eitherexpiry_ms
orcleanup_interval_ms
config values are missing. This should have been fixed ages ago. - Default
:pool_max_overflow
changed to0
. It's a better default, given that some users have seen weird errors when using a higher overflow. In general, capacity should be increased by using a higher:pool_size
instead - Changed how the ETS backend does cleanups of data, should be more performant.
- A new
check_rate_inc
function, which allows the caller to specify the integer with which to increment the bucket by. This is useful for limiting APIs which have some notion of "cost" per call.
- Use a worker-pool for the backend (via poolboy), this avoids bottle-necking all traffic through a single hammer process, thus improving throughput for the system overall
- New configuration options for backends:
:pool_size
, determines the number of workers in the pool (default 4):pool_max_overflow
, maximum extra workers to be spawned when the system is under pressure (default 4)
- Multiple instances of the same backend! You can now have two ETS backends, fifteen Redis's, whatever you want
- Require elixir >= 1.6
- Use a more sane supervision tree structure
- Add option to use more than one backend
- Add option to suppress all logging
- New, simpler API
- No longer need to start backend processes manually
- Call
Hammer.check_rate
directly, rather thanuse
ing a macro
- Hammer is now an OTP application, configured via
Mix.Config
- Formalise backend API in
Hammer.Backend
behaviour
- Minor fixes