Tuesday, July 17, 2012

Autoscaler Service Deployment




How to deploy Autoscaler Service?



You can install the “org.wso2.carbon.autoscaler.service.feature” feature in a WSO2 Application Server using WSO2 Elastic Load Balancer (ELB)'s p2-repo (We might be able to provide an installable AAR service). Note down the service URL, since it will be needed in order to communicate from another server.

Who decides when to autoscale?

In WSO2 LB, there is an autoscaler task which is responsible for taking autoscaling decisions. It analyzes the requests coming in and going out over a time period and decides whether existing worker nodes could handle the load [1]. If not it will call autoscaler service and ask to scale up an instance which is belong to the requires service domain. Similarly if the worker nodes aren't get utilized due to the small amount of average in flight requests, autoscaler task will ask autoscaler service to terminate an instance which is belong to the relevant service domain.

Further autoscaler task has few sanity checks. There it checks whether the minimum number of service instances specified in the loadbalancer.conf file is satisfied. If not it will automatically calls autoscaler service and spawn instances to match up the minimum instance counts of each service domain.


Who takes the autoscaling decision when there are multiple ELBs?

We are using Tribes coordination implementation. That means at any given point of time there is only one coordinator. And it is the coordinator, who is responsible for taking autoscaling decisions.


What if the coordinator ELB crashed?

ELB which acts as the coordinator send a notification message (each time its state get changed) to all other members in the ELB cluster in order to replicate its state. Hence, all other load balancers are aware of the facts which are needed in order to take an autoscaling decision.


What if the Autoscaler Service crashed?

Autoscaler service serialize all necessary and possible data into two files namely “domain-to-lastly-used-iaas.txt” and “iaas-context-list.txt”. If you have not specified a “serializationDir” element in “elastic-scaler-config.xml” file, the default directory will be used (i.e. {CARBON_HOME}/tmp).


How to enable autoscaling in WSO2 Elastic Load Balancer 2.0 ?

Before enabling autoscaling in WSO2 LB 2.0, it is recommended to read “Fronting WSO2 Application Server 5.0 cluster with WSO2 Elastic Load Balancer 2.0” [2]. That will walk you through on setting up a WSO2 server cluster and fronting it using WSO2 ELB without enabling autoscaling.

Now in order to enable autoscaling, you just need few tweaks to the loadbalancer.conf file of WSO2 ELB. Following is a portion of loadbalancer.conf, note the bold values which should be placed.

#configuration details of WSO2 Elastic Load Balancer
loadbalancer {
# minimum number of load balancer instances 
instances           1;
# whether autoscaling should be enabled or not, currently we do not support autoscaling
enable_autoscaler   true;
# End point reference of the Autoscaler Service
autoscaler_service_epr  https://10.100.3.104:9445/services/AutoscalerService/; 
# interval between two task executions in milliseconds 
autoscaler_task_interval 15000;
}
“autoscaler_task_interval” should be fine tuned according to your environment.

References:

[1] How Elasticity/Autoscaling is Handled
[2] Fronting WSO2 Application Server 5.0 cluster with WSO2 Elastic Load Balancer 2.0

1 comment:

Unknown said...

Once you choose a theme it is imperative that you perform wide research.

dissertation topics