Top Banner
Monitoring and Running Docker Containers at Scale Docker NYC Meetup February 25th, 2015
39

Monitoring Docker containers - Docker NYC Feb 2015

Jul 16, 2015

Download

Technology

DatadogSlides
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Monitoring Docker containers - Docker NYC Feb 2015

Monitoring and Running

Docker Containers at Scale

Docker NYC Meetup

February 25th, 2015

Page 2: Monitoring Docker containers - Docker NYC Feb 2015

@alq — CTO at Datadog

Page 3: Monitoring Docker containers - Docker NYC Feb 2015

Datadog• Monitoring service

• Made for the cloud

• Aggregates everything

• Support for Docker (since 1.0)

Page 4: Monitoring Docker containers - Docker NYC Feb 2015

Goal of this talkRethink the monitoring of Docker containers

Page 5: Monitoring Docker containers - Docker NYC Feb 2015

Agenda1.A (very) brief history of containers

2.Operational complexity

3.Monitoring Docker effectively

4.Demo

Page 6: Monitoring Docker containers - Docker NYC Feb 2015

A brief history of

containers

Page 7: Monitoring Docker containers - Docker NYC Feb 2015

Containers in a nutshell• Been around for a long time

– jails, zones, cgroups

• No full-virtualization overhead

• Used for runtime isolation (e.g. jails)

• Docker is an Escape from Dependency Hell

Page 8: Monitoring Docker containers - Docker NYC Feb 2015

Escape from dependency hell

a.out

shared libs

packages

omnibus

Docker ==?

Page 9: Monitoring Docker containers - Docker NYC Feb 2015

Mini-host or über-process?

Process Container Host

Spec Source Dockerfile Kickstart

On disk .TEXT /var/lib/docker /

In memory PID Container ID Hostname

In the network Socket veth* eth*

Runtime

context

server core host data center

Page 10: Monitoring Docker containers - Docker NYC Feb 2015

Mini-host or über-process?

Page 11: Monitoring Docker containers - Docker NYC Feb 2015

Operational

complexity

Page 12: Monitoring Docker containers - Docker NYC Feb 2015

Combinatorial multiplication

Hardware

OS

Off-the-shelf

Your Application

Hardware

Hypervisor

Off-the-

shelf

App

OS OS

Off-the-

shelf

App

Hardware

Hypervisor

OS OS

A A A A

Containers

O O O O

Page 13: Monitoring Docker containers - Docker NYC Feb 2015

Operational complexity• Average containers per host: N (N=5, 10/2014)

• N-times as many “hosts” to manage

• Affects

– provisioning: prep’ing & building containers

– configuration: passing config to containers

– orchestration: deciding where/when containers

run

– monitoring: making sure containers run

properly

Page 14: Monitoring Docker containers - Docker NYC Feb 2015

Complexity increases with...

1. Number of things to measure

2. Velocity of change

Page 15: Monitoring Docker containers - Docker NYC Feb 2015

Number of things to measure• 1 Amazon EC2 instance

– 10 CloudWatch metrics

• 1 operating system (e.g. linux)

– 100 metrics

•N containers

– 100*N metrics

•110 + 100*N metrics per instance

Page 16: Monitoring Docker containers - Docker NYC Feb 2015

Combinatorial multiplication

100 500instances containers

Assuming only 5 containers per instance

Page 17: Monitoring Docker containers - Docker NYC Feb 2015

Combinatorial multiplication

160 610metrics

per hostmetrics

per host

Assuming only 5 containers per

instance

Page 18: Monitoring Docker containers - Docker NYC Feb 2015

Combinatorial multiplication

100 61,000instances metrics

Assuming only 5 containers per instance

Page 19: Monitoring Docker containers - Docker NYC Feb 2015

Velocity

hours,

days,

months

minutes,

hours,

days

Host half-life Container half-life

Page 20: Monitoring Docker containers - Docker NYC Feb 2015

Aggravating factors• Registry-based provisioning

– new images as fast as you can git commit

• Autonomic orchestration

– from imperative to declarative

– automated

– individual containers don’t matter

– e.g. kubernetes, mesos

Page 21: Monitoring Docker containers - Docker NYC Feb 2015

A lot more,

A lot faster.

Page 22: Monitoring Docker containers - Docker NYC Feb 2015

If your monitoring is still centered on individual hosts or

instances…

Page 23: Monitoring Docker containers - Docker NYC Feb 2015

Host-centric monitoring

Monitor

Monitor

GA

P

Hypervisor

OS OS

A A A A

Containers

O O O O

Page 24: Monitoring Docker containers - Docker NYC Feb 2015

A lot more pain,

A lot faster.

Page 25: Monitoring Docker containers - Docker NYC Feb 2015

Monitoring containers

effectively

Page 26: Monitoring Docker containers - Docker NYC Feb 2015

A new approach to container monitoring

Page 27: Monitoring Docker containers - Docker NYC Feb 2015

Layers +

Tags

Page 28: Monitoring Docker containers - Docker NYC Feb 2015

Layers of monitoring

Monitor

Hypervisor

OS OS

A A A A

Containers

O O O O

Page 29: Monitoring Docker containers - Docker NYC Feb 2015

Layers of monitoring

CloudWatch

Infrastructure

Monitoring

APM

Hypervisor

OS OS

A A A A

Containers

O O O O

Page 30: Monitoring Docker containers - Docker NYC Feb 2015

Layers of monitoring

cpu/net/io

filesystem

docker mem

docker cpu

db queries

web requests

app throughput

CloudWatch

Infrastructure

Monitoring

APM

e.g

.

Hypervisor

OS OS

A A A A

Containers

O O O O

Page 31: Monitoring Docker containers - Docker NYC Feb 2015

Layers of monitoring• Access to metrics from all the layers

• Amazon CloudWatch, OS metrics, Docker metrics,

app metrics in 1 place

• Shared timeline

Page 32: Monitoring Docker containers - Docker NYC Feb 2015

If monitoring

does not cover all

layers,

pain.

Page 33: Monitoring Docker containers - Docker NYC Feb 2015

Tags (a.k.a. labels)

You (probably) already use them

Page 34: Monitoring Docker containers - Docker NYC Feb 2015

Tags• Monitoring is like Auto-Scaling Groups

• Monitoring is like Docker orchestration

• From imperative to declarative

• Query-based

• Queries operate on tags

Page 35: Monitoring Docker containers - Docker NYC Feb 2015

Monitoring with tags and queries

“Monitor all Docker containers running image web”

“… in region us-west-2 across all availability zones”

“… and make sure resident set size < 1GB on c3.xl”

Page 36: Monitoring Docker containers - Docker NYC Feb 2015

Monitoring with tags and queries

“Monitor all Docker containers running image web”

“… in region us-west-2 across all availability zones”

“… and make sure resident set size < 1GB on c3.xl”

Page 37: Monitoring Docker containers - Docker NYC Feb 2015

Monitoring with tags and queries

“Monitor all Docker containers running image web”

“… in region us-west-2 across all availability zones”

“… that use more than 1.5x the average on c3.xl”

Page 38: Monitoring Docker containers - Docker NYC Feb 2015

Demo: layers & tags

Page 39: Monitoring Docker containers - Docker NYC Feb 2015

Take-aways1. Docker increases operational complexity by an

order of magnitude unless…

2. You have layered monitoring, from the instance to

the container and to the application, and…

3. You monitor using tags and queries