Behaviours: sregulator_valve.
References
Implements a valve which increases its size based on decreasing intervals of updates being below a target between a minimum and maximum capacity.
sregulator_codel_value
can be used as the sregulator_valve
in a
sregulator
. Its argument is of the form:
{Target :: integer(), Interval :: pos_integer(), Min :: non_neg_integer(), Max :: non_neg_integer() | infinity}
Target
is the target relative value in milliseconds. Interval
is the
initial interval in milliseconds. The valve will open when updates remain
below the target (in native
time units) for an interval. Each consequeitive
is smaller than the last until an update above the target is received. The
valve is always open when below the minimum and always closed once it reaches
the maximum.
sbroker_queue
is moving quickly - up to a maximum.
Therefore this valves expects the updates to be samples from the
RelativeTime
in go
tuples. For example:
{go, _Ref, _Value, RelativeTime, _SojournTime} = sbroker:ask(Broker), sregulator:update(Regulator, RelativeTime).
To grow when a queue is moving slowly use -RelativeTime
.
The algorithm used in this valve is similar to sbroker_codel_queue
, except
designed to keep the relevant queue slow (but not too slow) instead of fast.
Therefore trying to ensure the counter party to the queue is always fast
without using too many resources. This works by increasing the concurrency or
number of requests when the queue is consistently fast and remaining static
when the queue is slow. Therefore forcing the queue to be slightly slow.
This valve is designed to be used a sbroker_codel_queue
with the same
Interval
and Target
s that are between 10% and 20% of the Interval
. The
target range is suggested due to the observation in the CoDel paper that the
queue goes from to fast to slow over this target range. Higher targets result
in heavily congested queues and wasted resources. A suggested initial
Interval
is the 95% percentile of the time it takes to stop a task and
restart, as this is equivalent to the round trip when a packet is dropped and
resent to rejoin the queue in the paper.
Decreasing the target of the valve makes it more resistant to bursts and reducing the target of the queue will increase the rate of shrinking when load decreases. This fulfils the general desire to increase resouce usage as late as possible and decrease resource usage as early as possible. If the queue's target is significantly lower than valve's this may lead to churn as the queue and valve may act against each other. Also if the minimum is too high the queue may drop the requests only for the valve to allow immediate enqueues.
More investigation needs to be done on suitable parameters.Generated by EDoc, Sep 29 2016, 17:17:28.