Fighting with scale

53
Fighting with scale things that “Getting started” doesn’t cover Adam Dubiel

Transcript of Fighting with scale

Page 1: Fighting with scale

Fighting with scalethings that “Getting started” doesn’t cover

Adam Dubiel

Page 2: Fighting with scale

We’re building a New World

Page 3: Fighting with scale

We used to have these..

Page 4: Fighting with scale

..and now we have these

Page 5: Fighting with scale

Microservices are needydiscovery

messaging

deployment

metrics

monitoring

storage

Page 6: Fighting with scale

Need for automation

env business

env business

Page 7: Fighting with scale

Choosing the right toolscan be hard

Page 8: Fighting with scale
Page 9: Fighting with scale

and then came docker..

Page 10: Fighting with scale

Metrics - graphite

Page 11: Fighting with scale

building blocks

frontend

dashboard

aggregator

storage

Page 12: Fighting with scale

building blocks

graphite-web

tessera

carbon

whisper

Page 13: Fighting with scale

building blocks

graphite-web

tessera

carbon

ceres

Page 14: Fighting with scale

building blocks

graphite-web

tessera

carbon

cyanite

Page 15: Fighting with scale

frontend

dashboard

influxdb

building blocks

Page 16: Fighting with scale

“getting started” setup

graphite-web

tessera

carbon

whisper

Page 17: Fighting with scale

1st iteration

Page 18: Fighting with scale

1st iteration - overall

Page 19: Fighting with scale

1st iteration - memory

Page 20: Fighting with scale

1st iteration - cause

Page 21: Fighting with scale

2nd iteration

OTH

ER

TEC

H

OTH

ER

TEC

H

Page 22: Fighting with scale

2nd iteration - memory

Page 23: Fighting with scale

2nd iteration - overall

Page 24: Fighting with scale

not only soft, drivers too

Page 25: Fighting with scale

Metrics - StatsD

Page 26: Fighting with scale

architecture

Host1

Host2

Graphite

metric.host1.rate

metric.host2.rateOK

Page 27: Fighting with scale

architecture

Host1

Host2

Graphite

metric.rate

metric.rateCLASH!

Page 28: Fighting with scale

architecture

Host1

Host2

Graphite

metric.rate

metric.rateOKStatsD

Page 29: Fighting with scale

problem?

Page 30: Fighting with scale

how to scale?

StatsDStatsD

StatsD proxy

Page 31: Fighting with scale

how to scale proxy…?

Page 32: Fighting with scale

Messaging - Hermes

Page 33: Fighting with scale

architecture

HermesFrontend

HermesConsumer

Page 34: Fighting with scale

Kafka is great!performant

fault-tolerant

robust

Page 35: Fighting with scale

but what with SLA?strict SLA, p99 < 100ms

stable p999 would be great

Page 36: Fighting with scale

cluster manipulations can be painful

Page 37: Fighting with scale

and beware of abusive clients

Page 38: Fighting with scale

1st iteration - Kafka leaders

Page 39: Fighting with scale

1st iteration - Kafka leaders

Page 40: Fighting with scale

1st iteration - Kafka leadersKafka does not distribute leaders uniformly

simple take-first algorithm

no tools to make it happen

go with #!/usr/bin/python

Page 41: Fighting with scale

2nd iteration - bufferingsimple solution to complex problem

use Kafka producer buffer

we can operate without Kafka for 1h!

Page 42: Fighting with scale
Page 43: Fighting with scale

and when we thought we have it all covered..bam!

corrupt message logs

Page 44: Fighting with scale

corrupt message logsKafka High Level Consumer can’t skip corrupt parts

no easy solution

time pressure - 24h retency

#!/usr/bin/python to the rescue!

Page 45: Fighting with scale

Lessons learned

Page 46: Fighting with scale

Production traffic is only on.. Production

Page 47: Fighting with scale

prepare for the Unknown

Page 48: Fighting with scale

..but mostly for problems

Page 49: Fighting with scale

scripts are your friends when time is the enemy

Page 50: Fighting with scale

centralisation sounds appealing(but seriously, don’t)

Page 51: Fighting with scale

focus onknowhow

agilityability to create clusters on demand

Page 52: Fighting with scale

isolate

Page 53: Fighting with scale

allegrotech.io

@allegrotechblog