tech talk on autoscaling in apache stratos
TRANSCRIPT
Autoscaling in
Apache Stratos
Vishanth Bala
2
Today’s Focus• Introduction to Autoscaling
• Apache Stratos Autoscaler Architecture
• Autoscale Policy and Strategies
• Demo
•Autoscaling
•Dependent Scaling
•Group Scaling
• Q&A
2
Introduction to Autoscaling
3
• Scalability
•Vertical (Scale up) - Going for a bigger instance
•Horizontal (Scale out) - Spawning more instances
• High Availability
3
Advantages of Autoscaling
4
• Better fault tolerance
• Better availability
• Better cost management
4
5
Autoscaling Architecture
5
•Requests in flight from the load balancer
•Cartridge Instance health statistics from Cartridge Agent
•Memory Consumptions
•CPU Consumptions
•CEP summarizes Average, Gradient and Second Derivative of
•Requests in flight
•Memory consumptions
•CPU consumptions
6
Event processing engine
6
•Capable of predicting future load
•Real time analysis of current load status using CEP
integration
•Predict immediate future load based on CEP resulting
streams
•Predicting equation s = ut + ½ at²
•s=predicted load
•u=first derivative of current average load
•t=time interval
•a=second derivative of current load77
Predicting Future Loads
8
Autoscaling workflow
8
9
Autoscale Member Lifecycle
9
● It is an Json file
● Holds the threshold values of decision making rules
● Specified at the cartridge level during the creation of the
application
10
Autoscale Policy
11
Sample Autoscale Policy{
"id": "my-autoscaling-policy","loadThresholds": {
"requestsInFlight": {"threshold": 50
},"memoryConsumption": {
"threshold": 85},"loadAverage": {
"threshold": 75}
}}
12
Sample Application Definition"cartridges": [ { "type": "php", "cartridgeMin": 1, "cartridgeMax": 5, "subscribableInfo": { "alias": "my-php", "autoscalingPolicy": "my-autoscaling-policy", "deploymentPolicy": "my-deployment-policy", }
}]
13
Autoscale Rules Engine• Why Rules Engine?
•Flexible
•Change it at runtime
•Readable
•Better performance
• Drools as the rule engine
14
Autoscale Rules Engine (2)• Rules we use
•Min check
•Max check
•Obsolete check
•Scaling
•Dependent-scaling
•Terminating all
•Terminating dependency
DEMO
16
Dependent Scaling• Scaling due to a dependent cartridge/group
• Sample Cartridge Definition"name": "esb-php-group",
"cartridges": [ "tomcat", "php" ], "dependencies": { "startupOrders": [ { "aliases": [
"cartridge.my-tomcat", "cartridge.my-php" ] } ], "terminationBehaviour": "terminate-none" }
17
Group Scaling• Scaling of a cartridge group
• When does it happen?
•members reach its maximum instance limit
•due to dependent scaling
18
Scaling scenario
19
Scaling scenario (2)
Q&A
Contact us !