NAME
Starch::Plugin::ThrottleStore - Throttle misbehaving Starch stores.
SYNOPSIS
my $starch = Starch->new(
plugins => ['::ThrottleStore'],
store => {
class => ...,
throttle_threshold => 2,
throttle_duration => 20,
},
);
DESCRIPTION
This plugin detects stores which are throwing errors consistently and disables them for a period of time.
When the "throttle_threshold" number of consecutive errors is reached all store operations will be disabled for "throttle_duration" seconds.
When the error threshold has been reached an erorr log message will be produced stating that throttling is starting. Each store access for the duration of the throttling will then produce a log message stating which state key is being throttled.
OPTIONAL STORE ARGUMENTS
These arguments are added to classes which consume the Starch::Store role.
throttle_threshold
How many consecutive errors which will trigger throttling. Defaults to 1
, which means the first error detected will begin throttling.
throttle_duration
How many seconds to throttle for once the "throttle_threshold" has been reached. Default to 60
(1 minute).
STORE ATTRIBUTES
These attributes are added to classes which consume the Starch::Store role.
throttle_error_count
Contains the current number of consecutive errors.
throttle_start
Contains the epoch time of when the "throttle_threshold" was passed and throttling began.
SUPPORT
See "SUPPORT" in Starch.
AUTHORS
See "AUTHORS" in Starch.
LICENSE
See "LICENSE" in Starch.