Search Results for

    Show / Hide Table of Contents

    Class DefaultResizer

    Implementation of Resizer that adjust the Pool based on specified thresholds.

    Inheritance
    object
    Resizer
    DefaultResizer
    Implements
    IEquatable<DefaultResizer>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.Routing
    Assembly: Akka.dll
    Syntax
    public class DefaultResizer : Resizer, IEquatable<DefaultResizer>

    Constructors

    | Edit this page View Source

    DefaultResizer(int, int, int, double, double, double, int)

    Initializes a new instance of the DefaultResizer class.

    Declaration
    public DefaultResizer(int lower, int upper, int pressureThreshold = 1, double rampupRate = 0.2, double backoffThreshold = 0.3, double backoffRate = 0.1, int messagesPerResize = 10)
    Parameters
    Type Name Description
    int lower

    TBD

    int upper

    TBD

    int pressureThreshold

    TBD

    double rampupRate

    TBD

    double backoffThreshold

    TBD

    double backoffRate

    TBD

    int messagesPerResize

    TBD

    Exceptions
    Type Condition
    ArgumentException

    This exception can be thrown for a number of reasons. These include:

    • The given lower bound was negative.
    • The given upper bound was negative.
    • The given upper bound was below the lowerbound.
    • The given rampupRate was negative.
    • The given backoffThreshold was greater than one.
    • The given backoffRate was negative.
    • The given messagesPerResize was less than one.

    Properties

    | Edit this page View Source

    BackoffRate

    Fraction of routees to be removed when the resizer reaches the backoffThreshold. For example, 0.1 would decrease 10% (rounded up), i.e. if current capacity is 9 it will request an decrease of 1 routee.

    Declaration
    public double BackoffRate { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    BackoffThreshold

    Minimum fraction of busy routees before backing off. For example, if this is 0.3, then we'll remove some routees only when less than 30% of routees are busy, i.e. if current capacity is 10 and 3 are busy then the capacity is unchanged, but if 2 or less are busy the capacity is decreased.

    Use 0.0 or negative to avoid removal of routees.

    Declaration
    public double BackoffThreshold { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    LowerBound

    The fewest number of routees the router should ever have.

    Declaration
    public int LowerBound { get; set; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    MessagesPerResize

    Number of messages between resize operation. Use 1 to resize before each message.

    Declaration
    public int MessagesPerResize { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    PressureThreshold

    • Threshold to evaluate if routee is considered to be busy (under pressure). Implementation depends on this value (default is 1).
    • 0: number of routees currently processing a message.
    • 1: number of routees currently processing a message has some messages in mailbox.
    • > 1: number of routees with at least the configured `pressureThreshold` messages in their mailbox. Note that estimating mailbox size of default UnboundedMailbox is O(N) operation.
    Declaration
    public int PressureThreshold { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    RampupRate

    Percentage to increase capacity whenever all routees are busy. For example, 0.2 would increase 20% (rounded up), i.e. if current capacity is 6 it will request an increase of 2 more routees.

    Declaration
    public double RampupRate { get; }
    Property Value
    Type Description
    double
    | Edit this page View Source

    UpperBound

    The most number of routees the router should ever have. Must be greater than or equal to lowerBound.

    Declaration
    public int UpperBound { get; set; }
    Property Value
    Type Description
    int

    Methods

    | Edit this page View Source

    Backoff(int, int)

    Computes a proposed negative (or zero) capacity delta using the configured backoffThreshold and backoffRate

    Declaration
    public int Backoff(int pressure, int capacity)
    Parameters
    Type Name Description
    int pressure

    pressure current number of busy routees

    int capacity

    capacity current number of routees

    Returns
    Type Description
    int

    proposed decrease in capacity (as a negative number)

    | Edit this page View Source

    Capacity(IEnumerable<Routee>)

    Returns the overall desired change in resizer capacity. Positive value will add routees to the resizer. Negative value will remove routees from the resizer

    Declaration
    public int Capacity(IEnumerable<Routee> currentRoutees)
    Parameters
    Type Name Description
    IEnumerable<Routee> currentRoutees

    The current actor in the resizer

    Returns
    Type Description
    int

    the number of routees by which the resizer should be adjusted (positive, negative or zero)

    | Edit this page View Source

    Equals(DefaultResizer)

    Declaration
    public bool Equals(DefaultResizer other)
    Parameters
    Type Name Description
    DefaultResizer other
    Returns
    Type Description
    bool
    | Edit this page View Source

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)
    | Edit this page View Source

    Filter(int, int)

    This method can be used to smooth the capacity delta by considering the current pressure and current capacity.

    Declaration
    public int Filter(int pressure, int capacity)
    Parameters
    Type Name Description
    int pressure

    pressure current number of busy routees

    int capacity

    capacity current number of routees

    Returns
    Type Description
    int

    proposed change in the capacity

    | Edit this page View Source

    FromConfig(Config)

    TBD

    Declaration
    public static DefaultResizer FromConfig(Config resizerConfig)
    Parameters
    Type Name Description
    Config resizerConfig

    TBD

    Returns
    Type Description
    DefaultResizer

    TBD

    | Edit this page View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    object.GetHashCode()
    | Edit this page View Source

    IsTimeForResize(long)

    TBD

    Declaration
    public override bool IsTimeForResize(long messageCounter)
    Parameters
    Type Name Description
    long messageCounter

    TBD

    Returns
    Type Description
    bool

    TBD

    Overrides
    Resizer.IsTimeForResize(long)
    | Edit this page View Source

    Pressure(IEnumerable<Routee>)

    Number of routees considered busy, or above 'pressure level'.

    Implementation depends on the value of pressureThreshold (default is 1).

    • 0: number of routees currently processing a message.
    • 1: number of routees currently processing a message has some messages in mailbox.
    • > 1: number of routees with at least the configured `pressureThreshold` messages in their mailbox. Note that estimating mailbox size of default UnboundedMailbox is O(N) operation.
    Declaration
    public int Pressure(IEnumerable<Routee> currentRoutees)
    Parameters
    Type Name Description
    IEnumerable<Routee> currentRoutees

    An enumeration of the current routees

    Returns
    Type Description
    int

    The number of routees considered to be above pressure level.

    | Edit this page View Source

    Rampup(int, int)

    Computes a proposed positive (or zero) capacity delta using the configured rampupRate.

    Declaration
    public int Rampup(int pressure, int capacity)
    Parameters
    Type Name Description
    int pressure

    the current number of busy routees

    int capacity

    the current number of total routees

    Returns
    Type Description
    int

    proposed increase in capacity

    | Edit this page View Source

    Resize(IEnumerable<Routee>)

    TBD

    Declaration
    public override int Resize(IEnumerable<Routee> currentRoutees)
    Parameters
    Type Name Description
    IEnumerable<Routee> currentRoutees

    TBD

    Returns
    Type Description
    int

    TBD

    Overrides
    Resizer.Resize(IEnumerable<Routee>)

    Implements

    IEquatable<T>

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET