kranky geek 2015 - decisions & considerations in building your webrtc app

68
© 2009-2015 TWILIO, INC. ALL RIGHTS RESERVED [email protected] PRODUCT MANAGER, SDKS ROB BRAZIER RUNNING RTC Operational lessons learned at Twilio.

Upload: kranky-geek

Post on 16-Apr-2017

547 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

RUNNING RTCOperational lessons learned at Twilio.

Page 2: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TWILIO?

Page 3: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Communication Channels

T W I L I O C O M M U N I C AT I O N S P L AT F O R M

VO I C E S M S M M S

W E B M O B I L E

Your Business Applications

I P M ESS A G I N G V I D E O

Page 4: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

750,000 Developers & Businesses

50 BILLION

API Interactions a year

O P E R AT I N G AT S C A L E

Page 5: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TWILIO AND WEBRTC?

Page 6: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 7: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

2011 2012 2013 2014 Present

TWILIO CLIENT 1.1: WEBRTC

TWILIO CLIENT: WEBRTC CALL VOLUME

WEBRTC RELEASED IN CHROME 23

TWILIO CLIENT 1.0: FLASH

Page 8: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

2011 2012 2013 2014 Present

TWILIO CLIENT 1.1: WEBRTC

TWILIO CLIENT 1.2: GLOBAL LOW LATENCY

TWILIO CLIENT: WEBRTC CALL VOLUME

WEBRTC RELEASED IN CHROME 23

WEBRTC RELEASED IN FIREFOX 22

TWILIO CLIENT 1.0: FLASH

Page 9: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

2011 2012 2013 2014 Present

TWILIO CLIENT 1.1: WEBRTC

TWILIO CLIENT 1.2: GLOBAL LOW LATENCY

TWILIO CLIENT: WEBRTC CALL VOLUME

WEBRTC RELEASED IN CHROME 23

WEBRTC RELEASED IN FIREFOX 22

TWILIO CLIENT 1.0: FLASH

Page 10: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

COMMON USE CASES

Page 11: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

COMMON USE CASES

CRM  and  SaaS  application  integration

Call  center  /  customer  service

Sharing  economy

Education  /  expertise  on-­‐demand

Recruiting

Anonymous  calling

Page 12: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

A HANDFUL OF OUR WEBRTC CUSTOMERS

Page 13: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

WEBRTC COMPLEXITY DOES NOT INCREASE LINEARLY.

Page 14: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 15: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Signaling  Server

Page 16: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Signaling  Server

Page 17: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Signaling  Server

Page 18: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Signaling  Server

TURN  Server

Page 19: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TURN  Server

Signaling  Server Media  Server

Conference  State

Page 20: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TURN  Server

Signaling  Server Media  Server SIP  Gateway

Conference  State

Page 21: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TURN  Server

Signaling  Server SIP  Gateway

Conference  State

Media  Server

Page 22: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TURN  Server

Signaling  Server SIP  Gateway

Conference  State

PSTN  GatewayMedia  Server

Carrier

Page 23: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TS SC PM CDC1

DC5

Page 24: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

DC3

TS SC PM C

DC7

DC6DC1

DC5

DC2

DC4

Page 25: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

SOMETHING WILL BREAK.

Page 26: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 27: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Stuff  you  can’t  control

Random  host  failure

Network  degradation

Spurious  network  traffic

Stuff  you  can  control

Resource  management

Operational  mishaps

Bugs  /  crashes

Page 28: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 29: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Tens  of  failures  /  week.

100%  up-­‐time  two  quarters  running.

99.95%  up-­‐time  for  the  year.

Page 30: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

TEST CONSTANTLY.

Page 31: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTS. CONTINUALLY TEST THE PRODUCT THE

SAME WAY THE CUSTOMER WILL.

Page 32: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

node-­‐webrtcsignaling

media

Page 33: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

node-­‐webrtcsignaling

media

Original  approach:

-­‐ Test  app  built  using  node-­‐webrtc.

-­‐ Acted  like  a  full-­‐fledged  browser  client.

-­‐ Ran  a  suite  of  tests  at  high  frequency  (some  tests  multiple  times  /  min,  other  tests  every  few  minutes).

Page 34: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

node-­‐webrtcsignaling

media

Page 35: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

node-­‐webrtcsignaling

media

Hard  to  maintain:

-­‐ Difficult  to  keep  up-­‐to-­‐date  with  WebRTC  changes.

-­‐ Build  challenges  (CentOS  6  on  AWS).

-­‐ (node-­‐webrtc  has  since  removed  MediaStream  API)

Page 36: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

node signaling

mediarobocallerssignaling

Page 37: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

node signaling

media

Revised  approach:

-­‐ Frequent  testing  for  service  monitoring  through  simple  node  websocket  client.

-­‐ Automated  browser  regression  testing  and  “thick”  scenario  testing  with  robocallers.

robocallerssignaling

Page 38: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Rollbar

Page 39: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

Page 40: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

END-TO-END TESTING

Manual  testing  tools:

-­‐ Automated  tests  won’t  catch  everything.

-­‐ Simple,  reliably  manual  testing  tools  for  rapidly  running  standard  scenarios  are  invaluable.

Page 41: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

End-­‐to-­‐end  tests

Anomaly  detection

Host  monitoring  (Nagios)

Manual  tools

Page 42: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

End-­‐to-­‐end  tests

Anomaly  detection

Host  monitoring  (Nagios)

Manual  tools

Layered  monitoring

-­‐ Event  aggregated  in  Rollbar  (and  assorted  other  tools).

-­‐ Alerts  delivered  through  PagerDuty.

Page 43: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

PLAN FOR FAILURE, PLAN FOR RECOVERY.

Page 44: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

DNS  distributionwss://www.mywebrtcservice.com

Registrar

Page 45: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Page 46: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Page 47: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Page 48: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

x  Many

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Page 49: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

x  10,000,000

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Page 50: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

x  10,000,000

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Rate  limit  here  to  protect  downstream  services

Page 51: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

x  10,000,000

Load  Balancer  A Load  Balancer  B

Gateway  A Gateway  B Gateway  C

Client

Registrar

Be  careful  about  locking  here

Page 52: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

EXPECT LOUSY NETWORKS.

Page 53: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Network Link Conditioner

Page 54: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

https://github.com/vadymy/networkThrottler

Page 55: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 56: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 57: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

Page 58: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

.GETSTATS() IS YOUR FRIEND.

Page 59: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

pc.getStats()

AMAZON KINESIS

MONITORING

REDSHIFT

Page 60: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

SOME OF THE STATS WE CAPTURE…

Page 61: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

audioInputLevel

audioOutputLevel

browser

jitter

rtt

received_packets

sent_packets

received_packets_lost

SOME OF THE STATS WE CAPTURE…

Page 62: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

SOME OF THE PATTERNS WE LOOK FOR…

Page 63: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

High  percentage  of  packets  lost

Excessive  jitter  or  rtt

Calls  >  5  seconds  with  no  packets  sent  but  >  0  audio-­‐input  level  (or  the  inverse;  evidence  of  one-­‐way  audio)

…look  for  patterns  by  Twilio  account,  endpoint  identity,  

browser  version,  etc.

SOME OF THE PATTERNS WE LOOK FOR…

Page 64: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

OPERATIONAL EXCELLENCE IS A CULTURE ISSUE.

Page 65: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

SOME CULTURAL TOOLS

Page 66: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

SOME CULTURAL TOOLS

Write  the  SLA  first

Build  it,  operate  it

Five-­‐Whys  Analysis

Fire  Drills

Runbooks

Post-­‐Mortems

Time  to  Recovery  Reports

Page 67: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

COMMUNICATIONS TOOLS ARE ONLY AS GOOD AS THEIR AVAILABILITY.

Page 68: Kranky Geek 2015 - Decisions & Considerations in building your WebRTC App

© 2009-2015 TWILIO, INC. ALL RIGHTS [email protected] PRODUCT MANAGER, SDKSROB BRAZIER

ROB BRAZIER [email protected]