Erlang for video delivery

Post on 21-Oct-2014

1,215 views 2 download

description

How Erlang is ideally suited for high volume and low latency systems like video on demand.

transcript

Erlangfor video delivery platforms

Friday, October 19, 12

About me

Worked for Delta, Bellsouth, Sun Microsystems, Weather Channel

Love realtime, high volume systems

Sr. Director Engineering EricssonN2 Broadband -> Tandberg TV -> Ericsson

hwatkins @ github

Friday, October 19, 12

Media Delivery Management SystemErlang (of course!)

Realtime processing

Protocol specific pieces

Ruby on Rails

Front end and some API’s

Friday, October 19, 12

Media Delivery Management SystemMongoDB

Persistence layer

Geo redundant

RabbitMQ (AMQP)

Messaging Bus

Friday, October 19, 12

VOD ecosystem

Friday, October 19, 12

Async processing

Friday, October 19, 12

Sync to Async

Friday, October 19, 12

Dynamic RoutingAbility to add components on the fly

Apply components to different profiles

In harmony with multiple VM’s

Friday, October 19, 12

Competing Consumer

Friday, October 19, 12

Clients

HTTP DSM-CCISO/IEC 13818-6

Friday, October 19, 12

Java binary protocol

Class per section

Lots of code

Lots of objects

Lots of GC

Friday, October 19, 12

Binary Data

Friday, October 19, 12

Pattern Matching

Friday, October 19, 12

Memory Management

Java

Shared memory with reference count

Erlang

per thread heap

single assignment

Friday, October 19, 12

Memory Footprint

Identical functionality developed in Java and Erlang

AMQP workers and connected to MongoDB

Java averaged 1 GB memory

Erlang averaged 200 MB memory

Friday, October 19, 12

Threading ModelThreading is ideal for things like http requests

Java

Threads heavyweight - thread pools

Erlang

Lightweight - spawn on demand

Think linear

Friday, October 19, 12

Clustering

Java

Memory - Terracotta

Erlang

Built in netadm:ping

Mnesia - disk or memory

Friday, October 19, 12

Runtime Debugging

REPL (Read-Eval-Print-Loop)

Cookie

Remote Shell

Issue commands

Friday, October 19, 12

OTP

Built for the real world - Use it!

application, gen_server and supervisor

Use alot!

gen_fsm and gen_event

Not as much but still useful

Friday, October 19, 12

OTP Custom Behavior

Friday, October 19, 12

Packagingreltool

rebar generate

start, stop, console, attach

runtime vm and libraries

small ~29M release

Friday, October 19, 12

Useful Libraries

Friday, October 19, 12

Rebar

De facto build system

Wrap in simple makefile for ease

Make dependancies easy to manage

Friday, October 19, 12

folsom

Github boundary/folsom

Metrics and counters during runtime

Expose through mochiweb

Friday, October 19, 12

Others

Mochiweb - Web Server

Webmachine - Rest

Friday, October 19, 12