sprotector_pie_meter (sbroker v1.1.1)
Registers the process with and updates the sprotector_server
using the "basic" PIE active queue management using approximate queue sojourn times.
sprotector_pie_meter
can be used as a sbroker_meter
in a sbroker
or a sregulator
. It will provide a short circuiter that will drop requests without messaging the broker or regulator with a probability using PIE for the ask
and ask_r
queue when the message queue length is approximately above a minimum and all requests when it is approximately above a maximum. Its argument, spec()
, is of the form: #{ask => #{target => AskTarget :: non_neg_integer(), % default: 100
interval => AskInterval :: pos_integer()}, % default: 1000
ask_r => #{target => AskRTarget :: non_neg_integer(), % default: 100
interval => AskRInterval :: pos_integer()}, % default: 1000
update => Update :: pos_integer(), % default: 100
min => Min :: non_neg_integer(), % default: 0
max => Max :: non_neg_integer() | infinity}. % default: infinity
AskTarget
is the target delay in milliseconds (defaults to 100
) for the ask
queue and AskInterval
is the initial interval in milliseconds (defaults to 1000
) before the first drop when the process's message queue is above the minimum size Min
(defaults to 0
) and below the maximum size Max
(defaults to infinity). `AskRTarget
and AskRInterval
are equivalent for the ask_r
queue. Update
is the interval between updating the drop probability (defaults to 100
).
100
milliseconds or less as instantaneous, and feels engaged with a system if response times are 1000
milliseconds or less. Therefore it is desirable for a system to respond within 1000
milliseconds as a worst case (upper percentile response time) and ideally to respond within 100
milliseconds (target response time). Thus the default target is 100
milliseconds and the default is interval 1000
milliseconds.See also: sprotector, sprotector_server.
Link to this section Summary
Link to this section Types
Link to this type
spec/0
Specs
spec() :: #{ask => #{target => AskTarget :: non_neg_integer(), interval => AskInterval :: pos_integer()}, ask_r => #{target => AskRTarget :: non_neg_integer(), interval => AskRInterval :: pos_integer()}, update => Update :: pos_integer(), min => Min :: non_neg_integer(), max => Max :: non_neg_integer() | infinity}.