Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Auto scaling decision maker

Location of auto scaling decision making task

The auto scaling decision making task currently resides on the WSO2 Elastic Load Balancer. The default implementation is:   org.wso2.carbon.mediator.autoscale.lbautoscale.task.ServiceRequestsInFlightAutoscaler

Basis for auto scaling

The current default implementation (ServiceRequestsInFlightAutoscaler) considers the number of requests in-flight as the basis for making auto scaling decisions. In the default algorithm we follow the paradigm “scale up early and scale down slowly”.

Decision making variables

  There are few auto scaling decision making variables, out of which all of the vital variables are configurable using the loadbalancer.conf file. 

...

The number of requests that come to the Elastic Load Balancer (ELB) for various service clusters are tracked.  A token is added for each incoming request against the relevant service cluster and the corresponding token is removed when a message has left the ELB or when the message expires. Thereby, the requests in-flight are calculated based on the token.

Decision making functions

The minimum number of instances and the maximum number of instances of service clusters are always respected. The system always maintains the minimum number of service instance requirements and the system will not scale beyond it's limit.

Calculations

The following is the calculation that is used to calculate the actual load based on the number of requests in-flight:

Panel
borderColorBlack
bgColorWhite
borderStylesolid

Average requests in-flight for a particular service cluster (avg) = total number of requests in-flight * (1/r)

Scaling Up

The following is the calculation that is used to calculate the expected number of maximum requests that a service instance can withstand. This in-turn is used to decide when the scaling up process should be carried out:

...

Panel
borderColorblack
bgColorwhite
borderStylesolid

avg > maxRpt * (number of running instances of this service cluster)

 
Scaling down

The following is the calculation that is used to calculate the imaginary lower bound value. This in-turn is used to decide when the scaling down process should be carried out:

...

Panel
borderColorblack
bgColorwhite
borderStylesolid

avg < minRpt * (number of running instances of this service cluster - 1)

...

Plugging in own implementation

...