2. Agenda
•
•
Introduction to Autoscaling
Apache Stratos Autoscaler Architecture
•
•
•
•
Component Architecture
•
Event Flow
Autoscale Policy
•
Introduction to Autoscaler Policy
•
Autoscaling Strategies
Deployment Policy •
Introduction to Deployment Policy
•
Capacity Planning with Deployment Policy
•
Partition Selection Algorithms
Rules Engine
•
Reasons for a Rule Engine
•
Rules for Apache Stratos Autoscaler
1
3. Introduction to Autoscaling
•
•
•
•
What is scalability
• Horizontal and vertical scaling
What is high availability
Proceedure
• Clustering
• Load balancing
Autoscaling
• Automating the capacity planning
2
4. Introduction to Autoscaling Contd.
•
•
•
•
•
Flexible cloud solution
•
•
User-defined policies, health status checks, and schedules.
Use case, cost, performance, and infrastructure.
SLA(Service Level Agreement) aware elastic cloud
•
•
•
QoS , SLA aware services
Daecision factors to consumers
Solves performance, availability, and economic costs issues
Capacity planning
•
Automated control of cloud: cost vs. Qos, find appropriate cloud model.
Cost Factor
•
Reduce economic cost and energy footprint
Proceedure
•
•
•
•
Online observation and monitoring the cloud
Trigger an event if a SLA violation happened
Use control theory and mathematical operations
Handling seasonal patterns. E.g. Year ends/ Weekends patterns
3
7. Health Statistics as Events
•
CEP receives events
•
Requests in flight from Load balancer
•
Cartridge instance health statistics from Cartridge agent
•
CPU consumption
•
Memory consumption
•
CEP summarize the Average, Gradient, and Second derivative events of,
•
Requests in Flight
•
CPU consumption
•
Memory consumption
6
8. Autoscale Policy
•
Deployable Xml model
•
Keeps Load thresholds for threshold based rules evaluation.
•
Deployed by Dev-ops or similar role at start or later
•
Hot Deployable.
•
Users Selects an Autoscale Policy on His Preference at Subscription Time.
7
10. Deployment Policy
•
Deployable xml model
•
Keeps the Capacity Planning.
•
Deployed by Dev-ops or similar role at start or later
•
Hot Deployable.
•
Users Selects an Deployment Policy on His Preference at Subscription Time.
9
12. Rules Engine
•
•
•
Why a Rules Engine
•
•
•
Ease of use: No byte code and easy to modify
Readable
Performances and sclability
Uses Drools engine as the default rules engine
Rules
• Minimum Rule
• Scale Up Rule
• Scale Down Rule
• Terminate All Rule
11
13. Autoscaling Rules: Sample in
Drools
rule "Minimum Rule"
dialect "mvel"
when
$service : Service ()
$cluster : Cluster () from $service.getClusters()
$policy : AutoscalePolicy(id == $cluster.autoscalePolicyName ) from $manager.getPolicyList()
$partition : Partition () from $policy.getHAPolicy().getPartitions()
$clusterContext : ClusterContext() from $context.getClusterContext($cluster.getClusterId())
eval($clusterContext.getPartitionCount($partition.getId()) < $partition.getPartitionMembersMin() )
then
int memberCountToBeIncreased = 1;
if($evaluator.delegateSpawn($partition,$cluster.getClusterId(), memberCountToBeIncreased)){
$clusterContext.increaseMemberCountInPartition($partition.getId(), memberCountToBeIncreased);
}
end
12
14. Minimum Rule
•
This runs when a “cluster created” event is received
•
Scan through all the partitions of the cluster and find minimums
•
Call CC for spawning required minimum instances
•
This will be also run periodically(with a higher time interval than scale up/down
rules) to assure that the minimum count is preserved
13
15. Scale Up/Down Rule
•
These rules run periodically
•
Evaluate load details(Received from CEP) against their thresholds(defined in
Autoscale Policy).
•
Decide whether to scale up, scale down, or do nothing
•
Call CC for spawning instances in selected partitions
14
18. Average of CPU/ Memory Consumption for a Specific Cluster
17
19. Terminate All Rule
•
•
•
This runs when a “cluster removed” event is received
Scan through all the partitions of the cluster and find member IDs to be
terminated
Call CC for terminating those instances
18
20. Fault Handling Scenarios
Process
VM
Down
Up
Down
Down(It can be that
agent is crashed)
Up
Up(but network
issue)
Decision flow
•
•
•
•
•
•
•
•
•
Cartridge agent publish event to CC
CC updates instance status in topology
Autoscaler decides to kill it
CEP identify that & publish event to Autoscaler
Autoscaler calls CC to terminate(if available) and remove the instance from
topology
Autoscaler will spawn another to cover that
CEP sends statistics on fault requests to Autoscaler
Autoscaler keep monitoring it and takes a decision to terminate the instance
Autoscaler will spawn another in the same partition to cover that
19
22. Join Us
Website
http://stratos.incubator.apache.org
Mailing List
Subscribe: dev-subscribe@stratos.incubator.apache.org
Post (After subscription): dev@stratos.incubator.apache.org
Social Media
Google+: https://plus.google.com/103515557134069849802
Twitter: https://twitter.com/ApacheStratos
Facebook: https://www.facebook.com/apache.stratos
LinkedIn: http://www.linkedin.com/groups?home=&gid=5131436
21