SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
T R E A S U R E D A T A
INFRASTRUCTURE FOR AUTO SCALING
DISTRIBUTED SYSTEMS
Auto scaling of distributed processing engine is not common.
So what we did.
Kai Sasaki
Software Engineer in Treasure Data
ABOUT ME
- Kai Sasaki (@Lewuathe)
- Software Engineer in Treasure Data since 2015
- PTD migration
- Remerge on MapReduce
- Presto Auto Scaling System
- Improving testing environment of query engine
Working in Query Engine Team (Managing Hive, Presto in Treasure data)
- Open Source Contributor of Hadoop, Hivemall, Spark, Presto, TensorFlow
TOPICS
Distributed Processing Engine
General architecture of distributed processing
engine and characteristics of specific platforms like
Hadoop, Presto used in Treasure Data.
Solution with Cloud
In order to achieve high scalable distributed
system, we make use of existing cloud features
like auto scaling group, deployment management
system.
Painful Scalable System
Auto scaling of distributed processing engine is not
common. We will describe the real pain point to
scale our distributed system.
AGENDA
• Distributed System in TD
• Presto and Hive
• Painful points to scale out distributed processing engine
• What we’ve done
• Decoupling storage layer
• Packaging and deployment on CodeDeploy
• Capacity resizing with Auto Scaling Group
• Real Auto Scaling
• CPU metrics
• Cost reduction
DISTRIBUTED PROCESSING ENGINE
HIVE AND PRESTO ON PLAZMADB
Bulk Import
Fluentd
Mobile SDK
PlazmaDB
Presto
Hive
SQL, CDP
Amazon S3
HIVE IN TREASURE DATA
• Multiple clusters with 50+ worker cluster
• Hive 0.13 (latest 3.0.0)
Stats
• 4+ million queries / month
• 257 trillion records / month
• 3+ PB / month
In May, 2018
PRESTO IN TREASURE DATA
• Multiple clusters with 40+ worker cluster
• Presto 0.188 (latest 0.201)
Stats
• 14+ million queries / month
• 1053 trillion records / month
• 19.7+ PB / month
In May, 2018
DISTRIBUTED PROCESSING IN TD
CoordinatorAppMaster
WorkerContainer
Scaling
WHY IS SCALING EFFECTIVE
• Distributed processing engine splits a job into multiple task fragments which can be run in
parallel. These task fragments are distributed to multiple worker nodes. Having more worker
nodes indicates may enable us to distribute smaller tasks to worker nodes.
SELECT
t1.user,
t1.path,
t2.email,
t2.address,
t2.age
FROM
www_access t1
JOIN
user_table t2
ON
t1.user = t2.user
WHERE
t1.path = ‘/register’ scan
scan
filter
join
output
WHY IS SCALING EFFECTIVE
• JOIN operation is a common in OLAP processing which generally consumes a lot of
computing resource. It is well known that there are efficient parallel join algorithms which can
be fully leveraged by distributing processing engine.
WHY IS SCALING EFFECTIVE
• Reading data from a backend storage (e.g. S3) is high latency operation. It can consume
much memory and network bandwidth. Distributing table scan fragments make it possible to
scatter the network load evenly.
PAIN POINTS
• Basically horizontal scaling of worker nodes in these system gives us a way to achieve
competitive performance easily without losing much time and money in theory.
• But there are several painful points to overcome in daily release.
• Stateful datasource
• Bootstrapping of the instance takes time.
• Manually tracking the deployment process is unstable.
• Configuration overridden mechanism is complex. (and also package version)
• Deployment verification (smoke test)
• Graceful shutdown to achieve reliable query running
• Specifying the target of deployment in multi-cloud environment
• Capacity estimation
HOW TO SCALE OUT OUR SYSTEM
DECOUPLING STORAGE LAYER
PlazmaDB Amazon S3
• Only intermediate/temporary data is stored in processing engine so that we discard any
instance in the cluster anytime. Replace input/output class with Plazma specific one.
CODEDEPLOY + AUTO SCALING GROUP
• We migrated our Presto infrastructure to Amazon CodeDeploy and EC2 Auto Scaling Group
which make it easy to create cluster based provisioning and scale out/in cluster capacity.
AWS 

CodeDeploy
Auto Scaling
Deploy Package
CODEDEPLOY
• CodeDeploy is a service of AWS to enable us to automate deployment flow. CodeDeploy
manages the steps of deployment of specific package as a whole.
• We can define a group where the package should be deployed.
• CodeDeploy package is just a zip file including all contents needed to run the application.
• Configs
• Binary package
• Hook scripts
• It manages the steps of application deployment as a whole. Versioning of package checking
application health, configuration rendering can be done via CodeDeploy.
DEPLOYMENT TARGET
• Specifying the target of deployment is troublesome in multi-cloud environment.
• Deployment target is a definition to specify unique resource where the package should be
deployed.
• site
• stage
• service
• cluster
• For example, a Presto cluster resource can be specified as this.
• presto-coordinator-default-production-aws
• presto-worker-default-production-aws
• Deployment specifies
• CodeDeploy package version to be deployed (Git tag)
• Deployment target
DEPLOYMENT TARGET
• Configuration has a overridden hierarchy based on the deployment target.
• You can define the default configuration value of each layer in deployment target.
• For example
• site=aws: -Xmx4G -Xms1G
• stage=production: -Xmx192G -Xms160G
• service=presto-worker: N/A
• cluster=one: -Xmx127G
• You can control the configuration in a fine-grained manner without losing the deployment
flexibility
CODEDEPLOY + AUTO SCALING GROUP
• Bootstrapping EC2 instance is delegated to Auto Scaling Group and application provisioning
can be done through AWS CodeDeploy.
• CodeDeploy package includes all application configurations.
ASG for workers
Master
CODEDEPLOY + AUTO SCALING GROUP
• If you increase the total capacity of ASG, ASG automatically bootstrap EC2 instance and
deploy the same CodeDeploy package as other workers have.
• Provisioning of cluster takes far less time (1+ hour -> 10mins) for 100 instances in total.
ASG for workers
Master
CODEDEPLOY + AUTO SCALING GROUP
• We can basically scale-in the cluster capacity in similar manner. One thing we need to take care
of is shutdown process. In order to avoid to fail on-going query, it is necessary to shutdown
instances gracefully. We use lifecycle hook to notify ASG when to shutdown the instance.
ASG for workers
Master
lifecycle hook
- complete
DEPLOYMENT HOOK
• CodeDeploy provides a way to run the hook script to prepare application deployment.
• ApplicationStop
• BeforeInstall
• AfterInstall
• ApplicationStart
• ValidationService
• It is easy to validate the application process running properly before joining into cluster by
running smoke test in ValidationService hook.
REAL AUTO SCALING
REAL “AUTO” SCALING…
• But we still need to specify the desired capacity manually…
• It’s based on our past history and experience.
Auto Scaling
40? 50? or more?
REAL AUTO SCALING
• Auto scaling policy feature provided an easy way to automatically scaling the cluster based on
the specific metric.
• Simple Scaling Policy
• Step Scaling Policy
• Target Tracking Scaling Policy
• Target tracking scaling policy enables us to adjust the cluster capacity in a fine grained
manner. It calculates the necessary capacity based on the gap between current metric and the
target value.
TARGET TRACKING OF CPU
• Workload simulation with 10~30 concurrent queries.
• Production size cluster (around 40 worker instances)
TARGET TRACKING OF CPU
• Expected cost reduction by the target value of CPU average usage.
TARGET TRACKING OF CPU
• Actual capacity transition with target tracking policy
• Target 40% CPU Usage and enabling scaling in.
FINALLY…
• It did not work properly because of
• Scale-in transition is conservative compared to scale-out. So cluster capacity tends to be
kept high long time. -> Cost increase
• Graceful shutdown also prevents to scale-in transition because long-running queries can
block instance termination.
FUTURE WORK
• Real Auto Scaling without using target tracking policy
• Detect a instance which can be in the shutdown process soon
• Estimate capacity based on application specific metrics
• Fine grained test to make sure query result consistency
• Auto query migration in case of outage
WE HUMAN ARE NOT AUTO SCALABLE!
https://www.treasuredata.com/company/careers/
T R E A S U R E D A T A

Contenu connexe

Tendances

Spark on Mesos
Spark on MesosSpark on Mesos
Spark on MesosJen Aman
 
Spark Summit EU talk by Luc Bourlier
Spark Summit EU talk by Luc BourlierSpark Summit EU talk by Luc Bourlier
Spark Summit EU talk by Luc BourlierSpark Summit
 
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...Spark Summit
 
Deploying Accelerators At Datacenter Scale Using Spark
Deploying Accelerators At Datacenter Scale Using SparkDeploying Accelerators At Datacenter Scale Using Spark
Deploying Accelerators At Datacenter Scale Using SparkJen Aman
 
Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...
Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...
Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...Continuent
 
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG DelhiRunning Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG DelhiSearce Inc
 
Micro-batching: High-performance writes
Micro-batching: High-performance writesMicro-batching: High-performance writes
Micro-batching: High-performance writesInstaclustr
 
Adaptive Query Execution: Speeding Up Spark SQL at Runtime
Adaptive Query Execution: Speeding Up Spark SQL at RuntimeAdaptive Query Execution: Speeding Up Spark SQL at Runtime
Adaptive Query Execution: Speeding Up Spark SQL at RuntimeDatabricks
 
Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...
Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...
Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...DataStax
 
Emr spark tuning demystified
Emr spark tuning demystifiedEmr spark tuning demystified
Emr spark tuning demystifiedOmid Vahdaty
 
analytic engine - a common big data computation service on the aws
analytic engine - a common big data computation service on the awsanalytic engine - a common big data computation service on the aws
analytic engine - a common big data computation service on the awsScott Miao
 
Spark Summit EU talk by Josef Habdank
Spark Summit EU talk by Josef HabdankSpark Summit EU talk by Josef Habdank
Spark Summit EU talk by Josef HabdankSpark Summit
 
The Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and Spark
The Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and SparkThe Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and Spark
The Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and SparkAkshay Rai
 
Deep Learning to Production with MLflow & RedisAI
Deep Learning to Production with MLflow & RedisAIDeep Learning to Production with MLflow & RedisAI
Deep Learning to Production with MLflow & RedisAIDatabricks
 
Stream Computing (The Engineer's Perspective)
Stream Computing (The Engineer's Perspective)Stream Computing (The Engineer's Perspective)
Stream Computing (The Engineer's Perspective)Ilya Ganelin
 
High Performance Computing (HPC) in cloud
High Performance Computing (HPC) in cloudHigh Performance Computing (HPC) in cloud
High Performance Computing (HPC) in cloudAccubits Technologies
 
Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...
Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...
Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...Databricks
 

Tendances (20)

Spark on Mesos
Spark on MesosSpark on Mesos
Spark on Mesos
 
Spark Summit EU talk by Luc Bourlier
Spark Summit EU talk by Luc BourlierSpark Summit EU talk by Luc Bourlier
Spark Summit EU talk by Luc Bourlier
 
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
Apache Spark the Hard Way: Challenges with Building an On-Prem Spark Analytic...
 
Deploying Accelerators At Datacenter Scale Using Spark
Deploying Accelerators At Datacenter Scale Using SparkDeploying Accelerators At Datacenter Scale Using Spark
Deploying Accelerators At Datacenter Scale Using Spark
 
Simplified Cluster Operation & Troubleshooting
Simplified Cluster Operation & TroubleshootingSimplified Cluster Operation & Troubleshooting
Simplified Cluster Operation & Troubleshooting
 
Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...
Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...
Webinar Slides: High Noon at AWS — Amazon RDS vs. Tungsten Clustering with My...
 
Enterprise Grade Streaming under 2ms on Hadoop
Enterprise Grade Streaming under 2ms on HadoopEnterprise Grade Streaming under 2ms on Hadoop
Enterprise Grade Streaming under 2ms on Hadoop
 
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG DelhiRunning Dataproc At Scale in production - Searce Talk at GDG Delhi
Running Dataproc At Scale in production - Searce Talk at GDG Delhi
 
Micro-batching: High-performance writes
Micro-batching: High-performance writesMicro-batching: High-performance writes
Micro-batching: High-performance writes
 
Adaptive Query Execution: Speeding Up Spark SQL at Runtime
Adaptive Query Execution: Speeding Up Spark SQL at RuntimeAdaptive Query Execution: Speeding Up Spark SQL at Runtime
Adaptive Query Execution: Speeding Up Spark SQL at Runtime
 
Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...
Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...
Micro-batching: High-performance Writes (Adam Zegelin, Instaclustr) | Cassand...
 
Emr spark tuning demystified
Emr spark tuning demystifiedEmr spark tuning demystified
Emr spark tuning demystified
 
Amazon EMR
Amazon EMRAmazon EMR
Amazon EMR
 
analytic engine - a common big data computation service on the aws
analytic engine - a common big data computation service on the awsanalytic engine - a common big data computation service on the aws
analytic engine - a common big data computation service on the aws
 
Spark Summit EU talk by Josef Habdank
Spark Summit EU talk by Josef HabdankSpark Summit EU talk by Josef Habdank
Spark Summit EU talk by Josef Habdank
 
The Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and Spark
The Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and SparkThe Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and Spark
The Fifth Elephant 2016: Self-Serve Performance Tuning for Hadoop and Spark
 
Deep Learning to Production with MLflow & RedisAI
Deep Learning to Production with MLflow & RedisAIDeep Learning to Production with MLflow & RedisAI
Deep Learning to Production with MLflow & RedisAI
 
Stream Computing (The Engineer's Perspective)
Stream Computing (The Engineer's Perspective)Stream Computing (The Engineer's Perspective)
Stream Computing (The Engineer's Perspective)
 
High Performance Computing (HPC) in cloud
High Performance Computing (HPC) in cloudHigh Performance Computing (HPC) in cloud
High Performance Computing (HPC) in cloud
 
Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...
Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...
Using SparkML to Power a DSaaS (Data Science as a Service) with Kiran Muglurm...
 

Similaire à 20180522 infra autoscaling_system

Building Scalable Applications with Microsoft Azure
Building Scalable Applications with Microsoft AzureBuilding Scalable Applications with Microsoft Azure
Building Scalable Applications with Microsoft AzureFisnik Doko
 
Machine Learning for Capacity Management
 Machine Learning for Capacity Management Machine Learning for Capacity Management
Machine Learning for Capacity ManagementEDB
 
Azure + DataStax Enterprise Powers Office 365 Per User Store
Azure + DataStax Enterprise Powers Office 365 Per User StoreAzure + DataStax Enterprise Powers Office 365 Per User Store
Azure + DataStax Enterprise Powers Office 365 Per User StoreDataStax Academy
 
Enabling presto to handle massive scale at lightning speed
Enabling presto to handle massive scale at lightning speedEnabling presto to handle massive scale at lightning speed
Enabling presto to handle massive scale at lightning speedShubham Tagra
 
Transforming to OpenStack: a sample roadmap to DevOps
Transforming to OpenStack: a sample roadmap to DevOpsTransforming to OpenStack: a sample roadmap to DevOps
Transforming to OpenStack: a sample roadmap to DevOpsNicolas (Nick) Barcet
 
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)Spark Summit
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesAmazon Web Services
 
Optimizing Presto Connector on Cloud Storage
Optimizing Presto Connector on Cloud StorageOptimizing Presto Connector on Cloud Storage
Optimizing Presto Connector on Cloud StorageKai Sasaki
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesAmazon Web Services
 
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)Apache Apex
 
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)Ontico
 
London Redshift Meetup - July 2017
London Redshift Meetup - July 2017London Redshift Meetup - July 2017
London Redshift Meetup - July 2017Pratim Das
 
Enabling Presto to handle massive scale at lightning speed
Enabling Presto to handle massive scale at lightning speedEnabling Presto to handle massive scale at lightning speed
Enabling Presto to handle massive scale at lightning speedShubham Tagra
 
Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...
Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...
Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...Amazon Web Services
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Amazon Web Services
 
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...AboutYouGmbH
 
MongoDB at MapMyFitness
MongoDB at MapMyFitnessMongoDB at MapMyFitness
MongoDB at MapMyFitnessMapMyFitness
 
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanAmazon Web Services
 
Lessons learned from embedding Cassandra in xPatterns
Lessons learned from embedding Cassandra in xPatternsLessons learned from embedding Cassandra in xPatterns
Lessons learned from embedding Cassandra in xPatternsClaudiu Barbura
 

Similaire à 20180522 infra autoscaling_system (20)

Building Scalable Applications with Microsoft Azure
Building Scalable Applications with Microsoft AzureBuilding Scalable Applications with Microsoft Azure
Building Scalable Applications with Microsoft Azure
 
Machine Learning for Capacity Management
 Machine Learning for Capacity Management Machine Learning for Capacity Management
Machine Learning for Capacity Management
 
Azure + DataStax Enterprise Powers Office 365 Per User Store
Azure + DataStax Enterprise Powers Office 365 Per User StoreAzure + DataStax Enterprise Powers Office 365 Per User Store
Azure + DataStax Enterprise Powers Office 365 Per User Store
 
Enabling presto to handle massive scale at lightning speed
Enabling presto to handle massive scale at lightning speedEnabling presto to handle massive scale at lightning speed
Enabling presto to handle massive scale at lightning speed
 
Transforming to OpenStack: a sample roadmap to DevOps
Transforming to OpenStack: a sample roadmap to DevOpsTransforming to OpenStack: a sample roadmap to DevOps
Transforming to OpenStack: a sample roadmap to DevOps
 
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
A Big Data Lake Based on Spark for BBVA Bank-(Oscar Mendez, STRATIO)
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute Services
 
Optimizing Presto Connector on Cloud Storage
Optimizing Presto Connector on Cloud StorageOptimizing Presto Connector on Cloud Storage
Optimizing Presto Connector on Cloud Storage
 
Intro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute ServicesIntro to AWS: Amazon EC2 and Compute Services
Intro to AWS: Amazon EC2 and Compute Services
 
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
GE IOT Predix Time Series & Data Ingestion Service using Apache Apex (Hadoop)
 
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
Spilo, отказоустойчивый PostgreSQL кластер / Oleksii Kliukin (Zalando SE)
 
London Redshift Meetup - July 2017
London Redshift Meetup - July 2017London Redshift Meetup - July 2017
London Redshift Meetup - July 2017
 
Enabling Presto to handle massive scale at lightning speed
Enabling Presto to handle massive scale at lightning speedEnabling Presto to handle massive scale at lightning speed
Enabling Presto to handle massive scale at lightning speed
 
Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...
Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...
Improving Availability & Lowering Costs with Auto Scaling & Amazon EC2 (CPN20...
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
 
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
Artur Borycki - Beyond Lambda - how to get from logical to physical - code.ta...
 
MongoDB at MapMyFitness
MongoDB at MapMyFitnessMongoDB at MapMyFitness
MongoDB at MapMyFitness
 
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity PlanDay 5 - AWS Autoscaling Master Class - The New Capacity Plan
Day 5 - AWS Autoscaling Master Class - The New Capacity Plan
 
Spark cep
Spark cepSpark cep
Spark cep
 
Lessons learned from embedding Cassandra in xPatterns
Lessons learned from embedding Cassandra in xPatternsLessons learned from embedding Cassandra in xPatterns
Lessons learned from embedding Cassandra in xPatterns
 

Plus de Kai Sasaki

Graviton 2で実現する
コスト効率のよいCDP基盤
Graviton 2で実現する
コスト効率のよいCDP基盤Graviton 2で実現する
コスト効率のよいCDP基盤
Graviton 2で実現する
コスト効率のよいCDP基盤Kai Sasaki
 
Infrastructure for auto scaling distributed system
Infrastructure for auto scaling distributed systemInfrastructure for auto scaling distributed system
Infrastructure for auto scaling distributed systemKai Sasaki
 
Continuous Optimization for Distributed BigData Analysis
Continuous Optimization for Distributed BigData AnalysisContinuous Optimization for Distributed BigData Analysis
Continuous Optimization for Distributed BigData AnalysisKai Sasaki
 
Recent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future PrestoRecent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future PrestoKai Sasaki
 
Real World Storage in Treasure Data
Real World Storage in Treasure DataReal World Storage in Treasure Data
Real World Storage in Treasure DataKai Sasaki
 
User Defined Partitioning on PlazmaDB
User Defined Partitioning on PlazmaDBUser Defined Partitioning on PlazmaDB
User Defined Partitioning on PlazmaDBKai Sasaki
 
Deep dive into deeplearn.js
Deep dive into deeplearn.jsDeep dive into deeplearn.js
Deep dive into deeplearn.jsKai Sasaki
 
Presto updates to 0.178
Presto updates to 0.178Presto updates to 0.178
Presto updates to 0.178Kai Sasaki
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case Kai Sasaki
 
Managing multi tenant resource toward Hive 2.0
Managing multi tenant resource toward Hive 2.0Managing multi tenant resource toward Hive 2.0
Managing multi tenant resource toward Hive 2.0Kai Sasaki
 
Embulk makes Japan visible
Embulk makes Japan visibleEmbulk makes Japan visible
Embulk makes Japan visibleKai Sasaki
 
Maintainable cloud architecture_of_hadoop
Maintainable cloud architecture_of_hadoopMaintainable cloud architecture_of_hadoop
Maintainable cloud architecture_of_hadoopKai Sasaki
 
図でわかるHDFS Erasure Coding
図でわかるHDFS Erasure Coding図でわかるHDFS Erasure Coding
図でわかるHDFS Erasure CodingKai Sasaki
 
Spark MLlib code reading ~optimization~
Spark MLlib code reading ~optimization~Spark MLlib code reading ~optimization~
Spark MLlib code reading ~optimization~Kai Sasaki
 
How I tried MADE
How I tried MADEHow I tried MADE
How I tried MADEKai Sasaki
 
Reading kernel org
Reading kernel orgReading kernel org
Reading kernel orgKai Sasaki
 
Kernel bootstrap
Kernel bootstrapKernel bootstrap
Kernel bootstrapKai Sasaki
 
HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案
HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案
HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案Kai Sasaki
 

Plus de Kai Sasaki (20)

Graviton 2で実現する
コスト効率のよいCDP基盤
Graviton 2で実現する
コスト効率のよいCDP基盤Graviton 2で実現する
コスト効率のよいCDP基盤
Graviton 2で実現する
コスト効率のよいCDP基盤
 
Infrastructure for auto scaling distributed system
Infrastructure for auto scaling distributed systemInfrastructure for auto scaling distributed system
Infrastructure for auto scaling distributed system
 
Continuous Optimization for Distributed BigData Analysis
Continuous Optimization for Distributed BigData AnalysisContinuous Optimization for Distributed BigData Analysis
Continuous Optimization for Distributed BigData Analysis
 
Recent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future PrestoRecent Changes and Challenges for Future Presto
Recent Changes and Challenges for Future Presto
 
Real World Storage in Treasure Data
Real World Storage in Treasure DataReal World Storage in Treasure Data
Real World Storage in Treasure Data
 
User Defined Partitioning on PlazmaDB
User Defined Partitioning on PlazmaDBUser Defined Partitioning on PlazmaDB
User Defined Partitioning on PlazmaDB
 
Deep dive into deeplearn.js
Deep dive into deeplearn.jsDeep dive into deeplearn.js
Deep dive into deeplearn.js
 
Presto updates to 0.178
Presto updates to 0.178Presto updates to 0.178
Presto updates to 0.178
 
How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case How to ensure Presto scalability 
in multi use case
How to ensure Presto scalability 
in multi use case
 
Managing multi tenant resource toward Hive 2.0
Managing multi tenant resource toward Hive 2.0Managing multi tenant resource toward Hive 2.0
Managing multi tenant resource toward Hive 2.0
 
Embulk makes Japan visible
Embulk makes Japan visibleEmbulk makes Japan visible
Embulk makes Japan visible
 
Maintainable cloud architecture_of_hadoop
Maintainable cloud architecture_of_hadoopMaintainable cloud architecture_of_hadoop
Maintainable cloud architecture_of_hadoop
 
図でわかるHDFS Erasure Coding
図でわかるHDFS Erasure Coding図でわかるHDFS Erasure Coding
図でわかるHDFS Erasure Coding
 
Spark MLlib code reading ~optimization~
Spark MLlib code reading ~optimization~Spark MLlib code reading ~optimization~
Spark MLlib code reading ~optimization~
 
How I tried MADE
How I tried MADEHow I tried MADE
How I tried MADE
 
Reading kernel org
Reading kernel orgReading kernel org
Reading kernel org
 
Reading drill
Reading drillReading drill
Reading drill
 
Kernel ext4
Kernel ext4Kernel ext4
Kernel ext4
 
Kernel bootstrap
Kernel bootstrapKernel bootstrap
Kernel bootstrap
 
HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案
HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案
HyperLogLogを用いた、異なり数に基づく
 省リソースなk-meansの
k決定アルゴリズムの提案
 

Dernier

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 

Dernier (20)

Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 

20180522 infra autoscaling_system

  • 1. T R E A S U R E D A T A INFRASTRUCTURE FOR AUTO SCALING DISTRIBUTED SYSTEMS Auto scaling of distributed processing engine is not common. So what we did. Kai Sasaki Software Engineer in Treasure Data
  • 2. ABOUT ME - Kai Sasaki (@Lewuathe) - Software Engineer in Treasure Data since 2015 - PTD migration - Remerge on MapReduce - Presto Auto Scaling System - Improving testing environment of query engine Working in Query Engine Team (Managing Hive, Presto in Treasure data) - Open Source Contributor of Hadoop, Hivemall, Spark, Presto, TensorFlow
  • 3. TOPICS Distributed Processing Engine General architecture of distributed processing engine and characteristics of specific platforms like Hadoop, Presto used in Treasure Data. Solution with Cloud In order to achieve high scalable distributed system, we make use of existing cloud features like auto scaling group, deployment management system. Painful Scalable System Auto scaling of distributed processing engine is not common. We will describe the real pain point to scale our distributed system.
  • 4. AGENDA • Distributed System in TD • Presto and Hive • Painful points to scale out distributed processing engine • What we’ve done • Decoupling storage layer • Packaging and deployment on CodeDeploy • Capacity resizing with Auto Scaling Group • Real Auto Scaling • CPU metrics • Cost reduction
  • 6. HIVE AND PRESTO ON PLAZMADB Bulk Import Fluentd Mobile SDK PlazmaDB Presto Hive SQL, CDP Amazon S3
  • 7. HIVE IN TREASURE DATA • Multiple clusters with 50+ worker cluster • Hive 0.13 (latest 3.0.0) Stats • 4+ million queries / month • 257 trillion records / month • 3+ PB / month In May, 2018
  • 8. PRESTO IN TREASURE DATA • Multiple clusters with 40+ worker cluster • Presto 0.188 (latest 0.201) Stats • 14+ million queries / month • 1053 trillion records / month • 19.7+ PB / month In May, 2018
  • 9. DISTRIBUTED PROCESSING IN TD CoordinatorAppMaster WorkerContainer Scaling
  • 10. WHY IS SCALING EFFECTIVE • Distributed processing engine splits a job into multiple task fragments which can be run in parallel. These task fragments are distributed to multiple worker nodes. Having more worker nodes indicates may enable us to distribute smaller tasks to worker nodes. SELECT t1.user, t1.path, t2.email, t2.address, t2.age FROM www_access t1 JOIN user_table t2 ON t1.user = t2.user WHERE t1.path = ‘/register’ scan scan filter join output
  • 11. WHY IS SCALING EFFECTIVE • JOIN operation is a common in OLAP processing which generally consumes a lot of computing resource. It is well known that there are efficient parallel join algorithms which can be fully leveraged by distributing processing engine.
  • 12. WHY IS SCALING EFFECTIVE • Reading data from a backend storage (e.g. S3) is high latency operation. It can consume much memory and network bandwidth. Distributing table scan fragments make it possible to scatter the network load evenly.
  • 13. PAIN POINTS • Basically horizontal scaling of worker nodes in these system gives us a way to achieve competitive performance easily without losing much time and money in theory. • But there are several painful points to overcome in daily release. • Stateful datasource • Bootstrapping of the instance takes time. • Manually tracking the deployment process is unstable. • Configuration overridden mechanism is complex. (and also package version) • Deployment verification (smoke test) • Graceful shutdown to achieve reliable query running • Specifying the target of deployment in multi-cloud environment • Capacity estimation
  • 14. HOW TO SCALE OUT OUR SYSTEM
  • 15. DECOUPLING STORAGE LAYER PlazmaDB Amazon S3 • Only intermediate/temporary data is stored in processing engine so that we discard any instance in the cluster anytime. Replace input/output class with Plazma specific one.
  • 16. CODEDEPLOY + AUTO SCALING GROUP • We migrated our Presto infrastructure to Amazon CodeDeploy and EC2 Auto Scaling Group which make it easy to create cluster based provisioning and scale out/in cluster capacity. AWS 
 CodeDeploy Auto Scaling Deploy Package
  • 17. CODEDEPLOY • CodeDeploy is a service of AWS to enable us to automate deployment flow. CodeDeploy manages the steps of deployment of specific package as a whole. • We can define a group where the package should be deployed. • CodeDeploy package is just a zip file including all contents needed to run the application. • Configs • Binary package • Hook scripts • It manages the steps of application deployment as a whole. Versioning of package checking application health, configuration rendering can be done via CodeDeploy.
  • 18. DEPLOYMENT TARGET • Specifying the target of deployment is troublesome in multi-cloud environment. • Deployment target is a definition to specify unique resource where the package should be deployed. • site • stage • service • cluster • For example, a Presto cluster resource can be specified as this. • presto-coordinator-default-production-aws • presto-worker-default-production-aws • Deployment specifies • CodeDeploy package version to be deployed (Git tag) • Deployment target
  • 19. DEPLOYMENT TARGET • Configuration has a overridden hierarchy based on the deployment target. • You can define the default configuration value of each layer in deployment target. • For example • site=aws: -Xmx4G -Xms1G • stage=production: -Xmx192G -Xms160G • service=presto-worker: N/A • cluster=one: -Xmx127G • You can control the configuration in a fine-grained manner without losing the deployment flexibility
  • 20. CODEDEPLOY + AUTO SCALING GROUP • Bootstrapping EC2 instance is delegated to Auto Scaling Group and application provisioning can be done through AWS CodeDeploy. • CodeDeploy package includes all application configurations. ASG for workers Master
  • 21. CODEDEPLOY + AUTO SCALING GROUP • If you increase the total capacity of ASG, ASG automatically bootstrap EC2 instance and deploy the same CodeDeploy package as other workers have. • Provisioning of cluster takes far less time (1+ hour -> 10mins) for 100 instances in total. ASG for workers Master
  • 22. CODEDEPLOY + AUTO SCALING GROUP • We can basically scale-in the cluster capacity in similar manner. One thing we need to take care of is shutdown process. In order to avoid to fail on-going query, it is necessary to shutdown instances gracefully. We use lifecycle hook to notify ASG when to shutdown the instance. ASG for workers Master lifecycle hook - complete
  • 23. DEPLOYMENT HOOK • CodeDeploy provides a way to run the hook script to prepare application deployment. • ApplicationStop • BeforeInstall • AfterInstall • ApplicationStart • ValidationService • It is easy to validate the application process running properly before joining into cluster by running smoke test in ValidationService hook.
  • 25. REAL “AUTO” SCALING… • But we still need to specify the desired capacity manually… • It’s based on our past history and experience. Auto Scaling 40? 50? or more?
  • 26. REAL AUTO SCALING • Auto scaling policy feature provided an easy way to automatically scaling the cluster based on the specific metric. • Simple Scaling Policy • Step Scaling Policy • Target Tracking Scaling Policy • Target tracking scaling policy enables us to adjust the cluster capacity in a fine grained manner. It calculates the necessary capacity based on the gap between current metric and the target value.
  • 27. TARGET TRACKING OF CPU • Workload simulation with 10~30 concurrent queries. • Production size cluster (around 40 worker instances)
  • 28. TARGET TRACKING OF CPU • Expected cost reduction by the target value of CPU average usage.
  • 29. TARGET TRACKING OF CPU • Actual capacity transition with target tracking policy • Target 40% CPU Usage and enabling scaling in.
  • 30. FINALLY… • It did not work properly because of • Scale-in transition is conservative compared to scale-out. So cluster capacity tends to be kept high long time. -> Cost increase • Graceful shutdown also prevents to scale-in transition because long-running queries can block instance termination.
  • 31. FUTURE WORK • Real Auto Scaling without using target tracking policy • Detect a instance which can be in the shutdown process soon • Estimate capacity based on application specific metrics • Fine grained test to make sure query result consistency • Auto query migration in case of outage
  • 32. WE HUMAN ARE NOT AUTO SCALABLE! https://www.treasuredata.com/company/careers/
  • 33. T R E A S U R E D A T A