managing and scaling microservices with docker in the wild

44
Managing and scaling microservices with Docker in the wild Alois Mayr @mayralois [email protected] Oct 27 th 2015

Upload: alois-mayr

Post on 23-Feb-2017

348 views

Category:

Software


1 download

TRANSCRIPT

Page 1: Managing and Scaling Microservices with Docker in the Wild

Managing and scaling microservices with Docker in the wild

Alois Mayr @mayralois [email protected]

Oct27th2015

Page 2: Managing and Scaling Microservices with Docker in the Wild

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Agenda

Page 3: Managing and Scaling Microservices with Docker in the Wild

Who we are and what we do

Page 4: Managing and Scaling Microservices with Docker in the Wild
Page 5: Managing and Scaling Microservices with Docker in the Wild

Whenpeopletalkaboutcloud-scalecompanies...

Page 6: Managing and Scaling Microservices with Docker in the Wild
Page 7: Managing and Scaling Microservices with Docker in the Wild

Industry adop-on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Page 8: Managing and Scaling Microservices with Docker in the Wild
Page 9: Managing and Scaling Microservices with Docker in the Wild
Page 10: Managing and Scaling Microservices with Docker in the Wild
Page 11: Managing and Scaling Microservices with Docker in the Wild

h+ps://ruxit.com/docker

Page 12: Managing and Scaling Microservices with Docker in the Wild

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Page 13: Managing and Scaling Microservices with Docker in the Wild

Credit:SlavoljubPantelic/Shu+erstock.com

Page 14: Managing and Scaling Microservices with Docker in the Wild

Monolithicdeployment:10-20servicesperprocess

Page 15: Managing and Scaling Microservices with Docker in the Wild

MicroservicesapplicaFon:1serviceperprocess20FmesthenumberofJVMs!

Page 16: Managing and Scaling Microservices with Docker in the Wild

MonolithicDeploymentofServices

FullMicroServiceDeploymentusingContainers

Service-orientedAPMdoesn’texposeJVMexplosionwithinmicroservicesarchitectures

Page 17: Managing and Scaling Microservices with Docker in the Wild

7:00a.m.Lowload,servicerunningwithminimumredundancy

12:00p.m.ScaledupserviceduringpeakloadwithfailoverofproblemaFcnode

7:00p.m.Scaledbackdowntolowerload,movetodifferentgeolocaFon

DeploymentsarenolongerstaHc

Page 18: Managing and Scaling Microservices with Docker in the Wild

Microservicesarchitecturescanbecomplex

Page 19: Managing and Scaling Microservices with Docker in the Wild

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra-on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Page 20: Managing and Scaling Microservices with Docker in the Wild

h+p://radar.oreilly.com/2015/10/swarm-v-fleet-v-kubernetes-v-mesos.html

Marathon EC2ContainerService

Page 21: Managing and Scaling Microservices with Docker in the Wild

CommonfeaturesoforchestraHontools

•  DistribuFonofcontainerswithinacluster•  Pre-configuredbyuseofDSL•  Poolingandco-locaFngcontainers/servicesbyvariousconcepts

•  Pods,labels,tags,taskdescripFons,etc.•  Resourceschedulingwithinacluster•  Scalingofresources/containers•  Servicehealthchecks•  Zero-downFmefail-overmechanisms•  Networking-SDNs

Page 22: Managing and Scaling Microservices with Docker in the Wild

Fail-overcontainersacrossdatacenters

1.Failedcontainer2.Newcontainer

Page 23: Managing and Scaling Microservices with Docker in the Wild

Low-trafficservice:2runningcontainers

Runningcontainers

Failedcontainer

Lowtraffic

Page 24: Managing and Scaling Microservices with Docker in the Wild

Containerview:traffic/load

ContainerisunderuFlized(Tomcatisidle)

Tomcatreceivesrequestsforabout15hrs

1serviceperTomcat

Page 25: Managing and Scaling Microservices with Docker in the Wild

Killingcontainerswheninfailuremode

Failurerateforhealthcheckincreased

Page 26: Managing and Scaling Microservices with Docker in the Wild

ShortcomingsofexisHngapproaches

•  StaFcpre-configuredcontainerorchestraFon•  Manuallyadjustednumberofrunningcontainers•  HealthchecksmaynotreflectservicefuncFonality/availability•  Schedulingbasedoninfrastructuremetrics:

•  Networktraffic•  CPUuFlizaFon

•  Absenceofservice-orientedscheduling

Page 27: Managing and Scaling Microservices with Docker in the Wild

MisconfiguraFoncankillorchestraFonlayer

Queueanddeploymentmethodsareslow

Page 28: Managing and Scaling Microservices with Docker in the Wild

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op-mizing microservices deployments

Is my environment healthy?

Page 29: Managing and Scaling Microservices with Docker in the Wild

What’simportant

1.  Whichservicesaretobeco-located?•  Relateservicestoinfrastructure•  Cascadingservicesimpactscheduling(snowballeffect)

2.  Capacityplanning•  Howmanyresourcesarerequired?•  Infrastructureandcontainermetrics

3.  What’stheidealnumberofcontainersperservice?4.  ServicedeploymentvalidaFon

• Whataretheeffectsofscalingservices?

Page 30: Managing and Scaling Microservices with Docker in the Wild

#1–Whocallswho?

Page 31: Managing and Scaling Microservices with Docker in the Wild

#1–Whocallswho?

Page 32: Managing and Scaling Microservices with Docker in the Wild

#1–Whocallswho?

Page 33: Managing and Scaling Microservices with Docker in the Wild

#1–Whocallswho?

MostFmespentinCreditCardVerificaFonservice

Page 34: Managing and Scaling Microservices with Docker in the Wild

#2–Capacityplanning

•  OrchestraFontoolscanusetags/labels•  Affinityandconstraintrules•  Capacityplanningbasedonlyonkeymetricsisinsufficient

•  CPU,Memory•  NetworkIOisimportantinmicroservicesarchitectures

Page 35: Managing and Scaling Microservices with Docker in the Wild

#1–Whichservicestobeco-located?#2–CapacityplanningincludesnetworkIO

Page 36: Managing and Scaling Microservices with Docker in the Wild

#3–Idealnumberofcontainersperservice?

•  Dependsonworkloadandservicedependencies•  Calledandcallingservices•  #Requests/minandslowest10%response-Fme•  CanbederivedfrommonitoringdataviaAPI

•  h+ps://blog.ruxit.com/ruxit-data-export-api/

Page 37: Managing and Scaling Microservices with Docker in the Wild

#4–ServicedeploymentvalidaHon

APP1APP2

APP1dependsonAPP2

Whereisthisspecified?

•  Resourceplanningandschedulingiswastedifdeploymentsdeviatefromplan

Page 38: Managing and Scaling Microservices with Docker in the Wild

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Page 39: Managing and Scaling Microservices with Docker in the Wild

Containermetricsaren’tenough

Page 40: Managing and Scaling Microservices with Docker in the Wild

Healthdependsonmanycomponentsandvariables!

Page 41: Managing and Scaling Microservices with Docker in the Wild

Be+ertoask:Whatbroke?

WhatsFllworks?

Page 42: Managing and Scaling Microservices with Docker in the Wild

820BILLIONdependencies!

ProblemresoluFonisascalabilityproblem

Waytoomanycomponentsinvolved

TheMushroomcloudeffectNetworkproblem

Page 43: Managing and Scaling Microservices with Docker in the Wild

1./logsranoutofspace

2./var/lib/dockerranoutofspace

Page 44: Managing and Scaling Microservices with Docker in the Wild

Freetrial-h+ps://ruxit.com/docker-monitoring/Blog-h+ps://blog.ruxit.com/

@ruxit

Try Ruxit for free! Work with us. Share your feedback

[email protected]