API Reference sbroker v1.1.1

Modules

This modules provides utility functions for load balancing using the best of two random choices. It is designed for use with sbroker and sregulator processes using the sbetter_meter meter. However any OTP process can use this module to do load balancing using the via naming format if the process is registered with and updates the sbetter_server.

Registers the process with and updates the sbetter_server with approximate queue sojourn times for use with the sbetter load balancer.

Server for storing the ask and ask_r values for load balanacing processes with sbetter.

This module provides a process match making service. A process joins one of two queues and is matched with a process in the other queue. The queues are managed using sbroker_queue callback module per queue so that a different strategy can be used for both queues. Processes that die while in a queue are automatically removed to prevent matching with a process that is nolonger alive. A broker also uses an sbroker_meter callback module to monitor the queue and processing delays of the broker.

Implements a head or tail drop queue with queue management based on CoDel (Controlling Queue Delay).

Implements a head or tail drop queue.

Implements a fair queue containing multiple sbroker_queue queues.

Behaviour for implementing meters for sbroker and sregulator.

Sets an alarm when the process's message queue is slow for an interval.

Behaviour for implementing queues for sbroker and sregulator.

Implements a head or tail drop queue with a timeout queue management algorithm

This module provides helpers for managing sbroker processes that are automatically started in the sbroker supervision tree.

This modules provides utility functions for overload protection and/or short circuiting calls to a process. It is designed for use with sbroker and sregulator processes using the sprotector_pie_meter meter. However any OTP process can use this module to do load balancing using the via naming format if the process is registered with and updates the sprotector_server.

Registers the process with and updates the sprotector_server using the "basic" PIE active queue management using approximate queue sojourn times.

Server for storing the ask and ask_r queue min, max and drop probabilities for overload protection and short circuiting for a process with sprotector.

This modules provides utility functions for basic load balancing based on choosing a random process. It is designed for use with OTP behaviour messaging using via names, e.g. {via, srand, {Process,...}}. The third element, {Process,...}, is a tuple containing pids (pid()) and/or process names (atom(), {global, any()}, {via, module(), any()} or {atom(), node()}). An element is chosen randomly, if the element is a pid() it is returned, otherwise the pid() of the process name is looked up.

This module provides a job regulator for controlling the level of concurrency of processes carrying out a task. A process requests permission to run and is queued until it is allowed to begin. Once the task is complete the process informs the regulator that is is done. Alternatively the process can ask if it can continue running and gains priority over any queued processes. The queue is managed using an sbroker_queue callback module, and the level of concurrency by an sregulator_valve callback module. The message queue delay and processing delay are monitorred by an sbroker_meter.

Implements a valve which increases its size based on CoDel (Controlling Queue Delay).

Implements a simple valve with maximum capacity.

Implements a valve with a rate limit between a minimum and maximum capacity.

Implements a valve which increases its size when an update is below a target.

Sets an alarm when the regulator's valve is slow to get a match for an interval.

Updates a list of regulators with the relative time of either queue.

This module provides helpers for managing sregulator processes that are automatically started in the sbroker supervision tree.

Behaviour for implementing values for sregulator.

This modules provides utility functions for basic load balancing based on the scheduler id of the calling process. It is designed for use with OTP behaviour messaging using via names, e.g. {via, sscheduler, {Process,...}}. The third element, {Process,...}, is a tuple containing pids (pid()) and/or process names (atom(), {global, any()}, {via, module(), any()} or {atom(), node()}). An element is chosen based on the scheduler id, if the element is a pid() it is returned, otherwise the pid() of the process name is looked up.