Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Freeing the Whale: How to Fail at Scale

Oliver Gould
November 10, 2016

Freeing the Whale: How to Fail at Scale

Twitter was once known for its ever-present error page, the “Fail Whale.” Thousands of staff-years later, this iconic image has all but faded from memory. This transformation was only possible due to Twitter’s treatment of failure as something not just to be expected, but to be embraced.

In this talk, we discuss the technical insights that enabled Twitter to fail, safely and often. We will show how Finagle, the high-scale RPC library used at Twitter, Pinterest, SoundCloud, and other companies, provides a uniform model for handling failure at the communications layer. We’ll describe Finagle’s multi-layer mechanism for handling failure (and its pernicious cousin, latency), including latency-aware load balancing, failure accrual, deadline propagation, retry budgets, and negative acknowledgement. Finally, we’ll describe Finagle’s unified model for naming, inspired by the concepts of symbolic naming and dynamic linking in operating systems, which allows it to extend failure handling across service cluster and datacenter boundaries. We will end with a roadmap for improvements upon this model and mechanisms for applying it to non-Finagle applications.

From QConSF 2016.

Oliver Gould

November 10, 2016
Tweet

More Decks by Oliver Gould

Other Decks in Technology

Transcript

  1. Freeing the Whale How to Fail at Scale oliver gould


    cto, buoyant QConSF, November 9, 2016 from
  2. Twitter, 2010 107 users 107 tweets/day 102 engineers 101 ops

    eng 101 services 101 deploys/week 102 hosts 0 datacenters 101 user-facing outages/week https://blog.twitter.com/2010/measuring-tweets
  3. Resilience is an imperative: our software runs on the truly

    dismal computers we call datacenters. Besides being heinously
 complex… they are unreliable and prone to
 operator error. Marius Eriksen @marius
 RPC Redux
  4. software you didn’t write hardware you can’t touch network you

    can’t trace break in new and surprising ways and your customers shouldn’t notice
  5. timelines Aurora (or Marathon, or …) host Mesos host host

    host host host users notifications x800 x300 x1000
  6. timelines Aurora (or Marathon, or …) host Mesos host host

    host host users notifications x800 x300 x1000
  7. datacenter [1] physical [2] link [3] network [4] transport kubernetes,

    mesos, swarm, … 
 canal, weave, … aws, azure, digitalocean, gce, … business languages, libraries [7] application rpc [5] session [6] presentation json, protobuf, thrift, … http/2, mux, …
  8. “It’s slow”
 is the hardest problem you’ll ever debug. Jeff

    Hodges @jmhodges
 Notes on Distributed Systems for Young Bloods
  9. timeouts & retries timelines users web db timeout=400ms retries=3 timeout=400ms

    retries=2 timeout=200ms retries=3 timelines users web db
  10. timeouts & retries timelines users web db timeout=400ms retries=3 timeout=400ms

    retries=2 timeout=200ms retries=3 timelines users web db 800ms! 600ms!
  11. lb algorithms: • round-robin • fewest connections • queue depth

    • exponentially-weighted moving average (ewma) • aperture request-level load balancing
  12. github.com/buoyantio/linkerd service mesh proxy built on finagle & netty suuuuper

    pluggable http, thrift, … etcd, consul, kubernetes, marathon, zookeeper, … …
  13. logical naming applications refer to logical names
 requests are bound

    to concrete names
 delegations express routing /s/users /#/io.l5d.zk/prod/users /#/io.l5d.zk/staging/users /s => /#/io.l5d.zk/prod
  14. linkerd service mesh transport security service discovery circuit breaking backpressure

    deadlines retries tracing metrics keep-alive multiplexing load balancing per-request routing service-level objectives Service B instance linkerd Service C instance linkerd Service A instance linkerd
  15. linkerd roadmap • Battle test HTTP/2 • TLS client certs

    • Deadlines • Dark Traffic • All configurable everything