Autoscaling Best Practices - WebPerf Barcelona Oct 2014

Preview:

DESCRIPTION

This talk is an evolution of the one presented at FOSDEM'14, we talk about what are the common practices and methodologies for autoscaling, we also cover some best practices and the global scope of autoscaling inside your infrastructure.

Citation preview

Marc  Cluet  

http://www.flickr.com/photos/gozalewis/3422530465/  

Who am I?!

Marc  Cluet  (@lynxman)    Catalan  in  London  Head  of  Operations  at  <redacted>  17  years  of  experience  as  a  SysAdmin  Founding  member  of  Juju  and  MAAS  while  at  Canonical  Built  a  DevOps  Engineering  Team  at  Rackspace  Been  DevOps’in  for  the  last  5  years  

Who am I?!

http://www.meetup.com/London-­‐DevOps/  

What is Autoscaling?!

What is Autoscaling?!

WASTED! €€€!

What is Autoscaling?!

What is Autoscaling?!

The ability to automatically or semi-automatically scale up and down a group of servers based on computing or traffic demand by provisioning new services!

http://www.flickr.com/photos/fischerfotos/7419253200/  

Traffic Patterns!

Traffic Patterns!

ON & OFF!Analytics!Banks/Tax Agencies!Test environments!

Traffic Patterns!

FAST GROWTH!Events!Business Growth!Slashdot Effect!

Traffic Patterns!

VARIABLE!News & Media!Event Registrations!Rapid fire sales!

Traffic Patterns!

CONSISTENT!HR Application!Accounting/Finance!E-mail!

Autoscaling Methodologies!

Time Based!Reactive!

Predictive!

Time Based Autoscaling!

Load  Balancer  

Server   Server  

Time Based Autoscaling!

Load  Balancer  

Server   Server  

9:00am!

Time Based Autoscaling!

Load  Balancer  

Server   Server  

Nov 1st!

Time Based Autoscaling!

Load  Balancer  

Server   Server   Server  

Time Based Autoscaling!

GOOD FOR!On & Off!Consistent!

Reactive Autoscaling!

Load  Balancer  

Server  60%  

Server  60%  

Reactive Autoscaling!

Load  Balancer  

Server  80%  

Server  80%  

Reactive Autoscaling!

Load  Balancer  

Server  60%  

Server  60%  

Server  40%  

Reactive Autoscaling!

Load  Balancer  

Server  30%  

Server  30%  

Server  30%  

Reactive Autoscaling!

Load  Balancer  

Server  45%  

Server  45%  

Reactive Autoscaling!

GOOD FOR!Fast Growth!Variable!

Predictive Autoscaling!

Load  Balancer  

Server   Server  

Predictive Autoscaling!

Load  Balancer  

Server   Server  

Forecasted!Traffic!+30%!

Predictive Autoscaling!

Load  Balancer  

Server   Server   Server  

Predictive Autoscaling!

GOOD FOR!Fast Growth!Variable!

Predictive Autoscaling!

Twitter  University    Improving  Resource    Efficiency  with  Apache  Mesos    Christina  Delimitriou  @chris_deli    http://goo.gl/AQmG8n  

http://www.flickr.com/photos/samuraislice/3309481048/  

Autoscaling Tools!

Autoscaling Tools!

Amazon Cloudformation!Based on Scaling Groups!High/Low Watermark!Scheduled Events!Uses base image + CF!

Autoscaling Tools!

Rackspace Autoscale!Based on Scaling Groups!High/Low Watermark!Scheduled Events!Uses Gold Image!

Autoscaling Tools!

Rightscale Autoscale!Based on Scaling Groups!High/Low Watermark Quorum!Scheduled Events!Uses Rightscale scripts!$$$!

Autoscaling Tools!

Heat!Based on Templates!High/Low Watermark!Scheduled Events!Uses Heat Scripts!DSL Compatible with CF!

Autoscaling Tools!

Scryer!Based on AI!Predictive Fidelity model!Feeds AWS API!

Autoscaling Tools!

Your own!!Collect your metrics!!collectd, diamond, statsd!

Have a good metrics database!!influxDB, whisper, rrd!

Autoscaling Tools!

Your own!!Write your own autoscaling code!!with message queues! :)!!attached to your code!!brain close to the centre of decision!

http://www.flickr.com/photos/68751915@N05/6355318323/  

Taking the most of it!

Beware of the Kraken!!Autoscaling can be dangerous!Have min-max allocations!

http://www.flickr.com/photos/liquidnight/5992114196/  

Taking the most of it!

Choose the right metrics!Stay with basic metrics!!CPU, mem, I/O disk/net!

Review autoscaling strategy with metrics!

Taking the most of it!

Choose your strategy!Scale up early!Scale down slowly!Don’t apply the same strategy to all apps!

Taking the most of it!

Phasing in and Phasing Out!Have in mind time to availability!Have in mind also decommission time!Golden Images can help speed!

https://www.flickr.com/photos/trojan_warrior/30419599/  

The full chain!

Autoscaling  Event  

Provisioning  Config  Mgmt   Deployment  

Service  Discovery   Orchestration  

Provisioning!

cloud-init

Configuration Mgmt!

Deployment!

Orchestration!

1.  Autoscaling!2.  Self Healing!3.  Cost Forecast!4.  Predictive!!

Service Discovery!

Service  Node  A  

Service  Publication  

Service  Node  B  

Service  Node  C  

Service Discovery!

Service  Node  A  

Health  Check  

Discovery  Agent  

Discovery  Agent  

Service  Node  B  

Health  Check  

Service  Publication  

Service Discovery!

https://www.flickr.com/photos/mikko_luntiala/12691267935  

https://www.flickr.com/photos/dullhunk/202872717  

@lynxman!

http://slideshare.net/lynxmanuk/!

!