managing and scaling microservices with docker in the wild

Post on 23-Feb-2017

348 Views

Category:

Software

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Managing and scaling microservices with Docker in the wild

Alois Mayr @mayralois alois.mayr@ruxit.com

Oct27th2015

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Agenda

Who we are and what we do

Whenpeopletalkaboutcloud-scalecompanies...

Industry adop-on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

h+ps://ruxit.com/docker

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Credit:SlavoljubPantelic/Shu+erstock.com

Monolithicdeployment:10-20servicesperprocess

MicroservicesapplicaFon:1serviceperprocess20FmesthenumberofJVMs!

MonolithicDeploymentofServices

FullMicroServiceDeploymentusingContainers

Service-orientedAPMdoesn’texposeJVMexplosionwithinmicroservicesarchitectures

7:00a.m.Lowload,servicerunningwithminimumredundancy

12:00p.m.ScaledupserviceduringpeakloadwithfailoverofproblemaFcnode

7:00p.m.Scaledbackdowntolowerload,movetodifferentgeolocaFon

DeploymentsarenolongerstaHc

Microservicesarchitecturescanbecomplex

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra-on and scaling

Op>mizing microservices deployments

Is my environment healthy?

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

Marathon EC2ContainerService

CommonfeaturesoforchestraHontools

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

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

Fail-overcontainersacrossdatacenters

1.Failedcontainer2.Newcontainer

Low-trafficservice:2runningcontainers

Runningcontainers

Failedcontainer

Lowtraffic

Containerview:traffic/load

ContainerisunderuFlized(Tomcatisidle)

Tomcatreceivesrequestsforabout15hrs

1serviceperTomcat

Killingcontainerswheninfailuremode

Failurerateforhealthcheckincreased

ShortcomingsofexisHngapproaches

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

•  Networktraffic•  CPUuFlizaFon

•  Absenceofservice-orientedscheduling

MisconfiguraFoncankillorchestraFonlayer

Queueanddeploymentmethodsareslow

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op-mizing microservices deployments

Is my environment healthy?

What’simportant

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

2.  Capacityplanning•  Howmanyresourcesarerequired?•  Infrastructureandcontainermetrics

3.  What’stheidealnumberofcontainersperservice?4.  ServicedeploymentvalidaFon

• Whataretheeffectsofscalingservices?

#1–Whocallswho?

#1–Whocallswho?

#1–Whocallswho?

#1–Whocallswho?

MostFmespentinCreditCardVerificaFonservice

#2–Capacityplanning

•  OrchestraFontoolscanusetags/labels•  Affinityandconstraintrules•  Capacityplanningbasedonlyonkeymetricsisinsufficient

•  CPU,Memory•  NetworkIOisimportantinmicroservicesarchitectures

#1–Whichservicestobeco-located?#2–CapacityplanningincludesnetworkIO

#3–Idealnumberofcontainersperservice?

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

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

#4–ServicedeploymentvalidaHon

APP1APP2

APP1dependsonAPP2

Whereisthisspecified?

•  Resourceplanningandschedulingiswastedifdeploymentsdeviatefromplan

Industry adop>on of microservices

Microservices deployments vs monolithic deployments

Container orchestra>on and scaling

Op>mizing microservices deployments

Is my environment healthy?

Containermetricsaren’tenough

Healthdependsonmanycomponentsandvariables!

Be+ertoask:Whatbroke?

WhatsFllworks?

820BILLIONdependencies!

ProblemresoluFonisascalabilityproblem

Waytoomanycomponentsinvolved

TheMushroomcloudeffectNetworkproblem

1./logsranoutofspace

2./var/lib/dockerranoutofspace

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

@ruxit

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

alois.mayr@ruxit.com

top related