SlideShare a Scribd company logo
Autoscaler Architecture

Lahiru Sandaruwan
Apache Committer - Stratos(Incubating) , Software Engineer - WSO2 Inc
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
Introduction to Autoscaling
•

•
•

•

What is scalability
• Horizontal and vertical scaling
What is high availability
Proceedure
• Clustering
• Load balancing
Autoscaling
• Automating the capacity planning

2
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
Autoscaler
Component
Architecture

4
Event
Flow

5
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
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
Autoscale Policy contd.
<autoscalePolicy id="economy-autoscale">
<loadThresholds>
<requestsInFlight>
<average value="40" />
<gradient value="1" />
<secondDerivative value="0" />
<scaleDownMarginOfGradient value="1.0" />
<scaleDownMarginOfSecondDerivative value="0.2" />
</requestsInFlight>
<memoryConsumption>
...
</memoryConsumption>
<loadAverage>
...
</loadAverage>
</loadThresholds>
</autoscalePolicy>

8
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
Deployment Policy contd.
<deploymentPolicy id =”economy-deployment”>
<partitionGroups>
<partitionGroup id=”group1” >
<partitionAlgo>OneAfterAnother</partitionAlgo>
<partition id="partition1" >
<max>3</max>
<min>1</min>
</partition>
<partition id="partition2" >
<max>5</max>
<min>1</min>
</partition>
<partition id="partition3">
<max>20</max>
<min>1</min>
</partition>
</partitionGroup>
...
</deploymentPolicy>

10
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
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
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
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
Autoscaling Strategies
•

•

Threshold based autoscaling

Predictive or proactive auto-scaling techniques
• Kalman Filter
• Control Theory
• Time series analysis

15
Average of Requests In Flight at LB for a Specific Cluster

16
Average of CPU/ Memory Consumption for a Specific Cluster

17
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
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
References
1.
2.
3.

http://eurosys2010-dev.sigops-france.fr/workshops/FeBID2010/bouchenak.pdf
http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/WhatIsAutoScaling.html
http://www.sc.ehu.es/ccwbayes/isg/administrator/components/com_jresearch/files/publications/autoscaling.pdf

20
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
Thank you

22

More Related Content

PDF
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
PDF
CEP Integration for Apache Stratos 4.0.0
PDF
Overview of apache stratos (incubation) 4.0 architecture
PDF
Apache stratos hangout 3
PDF
Apache Stratos Incubator - hangout 2
PDF
The Role of Elastic Load Balancer - Apache Stratos
PDF
Load Balancer Component Architecture - Apache Stratos 4.0.0
PDF
Apache stratos (incubation) technical deep dive
Apache Stratos (incubating) Hangout IV - Stratos Controller and CLI Internals
CEP Integration for Apache Stratos 4.0.0
Overview of apache stratos (incubation) 4.0 architecture
Apache stratos hangout 3
Apache Stratos Incubator - hangout 2
The Role of Elastic Load Balancer - Apache Stratos
Load Balancer Component Architecture - Apache Stratos 4.0.0
Apache stratos (incubation) technical deep dive

What's hot (20)

PPTX
How to Autoscale in Apache Cloudstack using LiquiD AutoScaler
PPTX
Openstack heat & How Autoscaling works
PPTX
Spring Cloud and Netflix Components
PPTX
Autoscale without netscaler_ccceu13
PDF
Apache Kafka® Security Overview
PDF
Fully fault tolerant real time data pipeline with docker and mesos
PDF
Best Practice for Deploying Application with Heat
PDF
AWS Study Group - Chapter 10 - Matching Supply and Demand [Solution Architect...
PPTX
Cloudstack autoscaling
PDF
Container Orchestrator Smackdown @ContinousLifecycle
ODP
Kafka aws
PDF
Akka at Enterprise Scale: Performance Tuning Distributed Applications
PDF
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
PDF
KSQL Intro
PDF
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
PPTX
Openstack Heat
PPTX
Real time data pipeline with spark streaming and cassandra with mesos
PDF
9 plugin Cloudstack Developer Day
PPTX
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
PDF
Microservices with Netflix OSS and Spring Cloud
How to Autoscale in Apache Cloudstack using LiquiD AutoScaler
Openstack heat & How Autoscaling works
Spring Cloud and Netflix Components
Autoscale without netscaler_ccceu13
Apache Kafka® Security Overview
Fully fault tolerant real time data pipeline with docker and mesos
Best Practice for Deploying Application with Heat
AWS Study Group - Chapter 10 - Matching Supply and Demand [Solution Architect...
Cloudstack autoscaling
Container Orchestrator Smackdown @ContinousLifecycle
Kafka aws
Akka at Enterprise Scale: Performance Tuning Distributed Applications
Tales from the four-comma club: Managing Kafka as a service at Salesforce | L...
KSQL Intro
Using Kafka as a Database For Real-Time Transaction Processing | Chad Preisle...
Openstack Heat
Real time data pipeline with spark streaming and cassandra with mesos
9 plugin Cloudstack Developer Day
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Microservices with Netflix OSS and Spring Cloud
Ad

Similar to Autoscaler architecture of apache stratos 4.0.0 (20)

PPTX
Tech Talk on Autoscaling in Apache Stratos
PDF
Deploying at scale with PaaS
PDF
PaaS: An Introduction
PDF
Mongo DB on Apache Stratos
PDF
Workload-Aware: Auto-Scaling A new paradigm for Big Data Workloads
PDF
Demystifying the cloud
PDF
Scalable Web Applications Session at Codebase
PDF
Autoscaling Best Practices - WebPerf Barcelona Oct 2014
PDF
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
PDF
Auto scaling using Amazon Web Services ( AWS )
PDF
Auto Scaling Guided by Code
PPTX
Scalable Web Applications in AWS, 2014
PDF
QCon New York 2014 - Apache Stratos
PDF
Resource Replication & Automated Scaling Listener
PPTX
Deploy in scale with docker, coreos, kubernetes and apache stratos
PDF
August-20_Autoscaling-and-Cost-Optimization-on-Kubernetes-From-0-to-100.pdf
PDF
Scalable Web Apps - Journey Through the Cloud
PDF
Essential Elements of an Enterprise PaaS
PDF
ApacheCon Essential Elements of an Enterprise PaaS
PDF
Wso2 con 2014-us-talk-deep dive into apache stratos & private paas
Tech Talk on Autoscaling in Apache Stratos
Deploying at scale with PaaS
PaaS: An Introduction
Mongo DB on Apache Stratos
Workload-Aware: Auto-Scaling A new paradigm for Big Data Workloads
Demystifying the cloud
Scalable Web Applications Session at Codebase
Autoscaling Best Practices - WebPerf Barcelona Oct 2014
Virtual Flink Forward 2020: Autoscaling Flink at Netflix - Timothy Farkas
Auto scaling using Amazon Web Services ( AWS )
Auto Scaling Guided by Code
Scalable Web Applications in AWS, 2014
QCon New York 2014 - Apache Stratos
Resource Replication & Automated Scaling Listener
Deploy in scale with docker, coreos, kubernetes and apache stratos
August-20_Autoscaling-and-Cost-Optimization-on-Kubernetes-From-0-to-100.pdf
Scalable Web Apps - Journey Through the Cloud
Essential Elements of an Enterprise PaaS
ApacheCon Essential Elements of an Enterprise PaaS
Wso2 con 2014-us-talk-deep dive into apache stratos & private paas
Ad

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Cloud computing and distributed systems.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPT
Teaching material agriculture food technology
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25 Week I
NewMind AI Monthly Chronicles - July 2025
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
Cloud computing and distributed systems.
Review of recent advances in non-invasive hemoglobin estimation
“AI and Expert System Decision Support & Business Intelligence Systems”
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx
Teaching material agriculture food technology
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
20250228 LYD VKU AI Blended-Learning.pptx
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)

Autoscaler architecture of apache stratos 4.0.0

  • 1. Autoscaler Architecture Lahiru Sandaruwan Apache Committer - Stratos(Incubating) , Software Engineer - WSO2 Inc
  • 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
  • 9. Autoscale Policy contd. <autoscalePolicy id="economy-autoscale"> <loadThresholds> <requestsInFlight> <average value="40" /> <gradient value="1" /> <secondDerivative value="0" /> <scaleDownMarginOfGradient value="1.0" /> <scaleDownMarginOfSecondDerivative value="0.2" /> </requestsInFlight> <memoryConsumption> ... </memoryConsumption> <loadAverage> ... </loadAverage> </loadThresholds> </autoscalePolicy> 8
  • 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
  • 11. Deployment Policy contd. <deploymentPolicy id =”economy-deployment”> <partitionGroups> <partitionGroup id=”group1” > <partitionAlgo>OneAfterAnother</partitionAlgo> <partition id="partition1" > <max>3</max> <min>1</min> </partition> <partition id="partition2" > <max>5</max> <min>1</min> </partition> <partition id="partition3"> <max>20</max> <min>1</min> </partition> </partitionGroup> ... </deploymentPolicy> 10
  • 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
  • 16. Autoscaling Strategies • • Threshold based autoscaling Predictive or proactive auto-scaling techniques • Kalman Filter • Control Theory • Time series analysis 15
  • 17. Average of Requests In Flight at LB for a Specific Cluster 16
  • 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