21
Autoscaling in Apache Stratos Vishanth Bala

Tech Talk on Autoscaling in Apache Stratos

Embed Size (px)

Citation preview

Page 1: Tech Talk on Autoscaling in Apache Stratos

Autoscaling in

Apache Stratos

Vishanth Bala

Page 2: Tech Talk on Autoscaling in Apache Stratos

2

Today’s Focus• Introduction to Autoscaling

• Apache Stratos Autoscaler Architecture

• Autoscale Policy and Strategies

• Demo

•Autoscaling

•Dependent Scaling

•Group Scaling

• Q&A

2

Page 3: Tech Talk on Autoscaling in Apache Stratos

Introduction to Autoscaling

3

• Scalability

•Vertical (Scale up) - Going for a bigger instance

•Horizontal (Scale out) - Spawning more instances

• High Availability

3

Page 4: Tech Talk on Autoscaling in Apache Stratos

Advantages of Autoscaling

4

• Better fault tolerance

• Better availability

• Better cost management

4

Page 5: Tech Talk on Autoscaling in Apache Stratos

5

Autoscaling Architecture

5

Page 6: Tech Talk on Autoscaling in Apache Stratos

•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

Page 7: Tech Talk on Autoscaling in Apache Stratos

•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

Page 8: Tech Talk on Autoscaling in Apache Stratos

8

Autoscaling workflow

8

Page 9: Tech Talk on Autoscaling in Apache Stratos

9

Autoscale Member Lifecycle

9

Page 10: Tech Talk on Autoscaling in Apache Stratos

● 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

Page 11: Tech Talk on Autoscaling in Apache Stratos

11

Sample Autoscale Policy{

"id": "my-autoscaling-policy","loadThresholds": {

"requestsInFlight": {"threshold": 50

},"memoryConsumption": {

"threshold": 85},"loadAverage": {

"threshold": 75}

}}

Page 12: Tech Talk on Autoscaling in Apache Stratos

12

Sample Application Definition"cartridges": [ { "type": "php", "cartridgeMin": 1, "cartridgeMax": 5, "subscribableInfo": { "alias": "my-php", "autoscalingPolicy": "my-autoscaling-policy", "deploymentPolicy": "my-deployment-policy", }

}]

Page 13: Tech Talk on Autoscaling in Apache Stratos

13

Autoscale Rules Engine• Why Rules Engine?

•Flexible

•Change it at runtime

•Readable

•Better performance

• Drools as the rule engine

Page 14: Tech Talk on Autoscaling in Apache Stratos

14

Autoscale Rules Engine (2)• Rules we use

•Min check

•Max check

•Obsolete check

•Scaling

•Dependent-scaling

•Terminating all

•Terminating dependency

Page 15: Tech Talk on Autoscaling in Apache Stratos

DEMO

Page 16: Tech Talk on Autoscaling in Apache Stratos

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" }

Page 17: Tech Talk on Autoscaling in Apache Stratos

17

Group Scaling• Scaling of a cartridge group

• When does it happen?

•members reach its maximum instance limit

•due to dependent scaling

Page 18: Tech Talk on Autoscaling in Apache Stratos

18

Scaling scenario

Page 19: Tech Talk on Autoscaling in Apache Stratos

19

Scaling scenario (2)

Page 20: Tech Talk on Autoscaling in Apache Stratos

Q&A

Page 21: Tech Talk on Autoscaling in Apache Stratos

Contact us !