Top Banner
Netflix and FreeBSD: Using Open Source to Deliver Streaming Video Jonathan Looney FOSDEM 2019
25

Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Feb 10, 2019

Download

Documents

lyphuc
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: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Netflix and FreeBSD:Using Open Sourceto Deliver StreamingVideo

Jonathan LooneyFOSDEM 2019

Page 2: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

NETFLIX AND FREEBSDFOSDEM 2019

Open Connect

Page 3: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Open Connect is Netflix’s CDN.It is global, efficient, and purpose-built for distributing Netflix’s content.

NETFLIX AND FREEBSDFOSDEM 2019

Page 4: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

The Open Connect Appliance

The OCA is the “backbone” of the Open Connect network.

The OCA almost exclusively runs open-source software.

NETFLIX AND FREEBSDFOSDEM 2019

40Gb/s Storage Appliance with 248TB storage(2RU form factor)

Page 5: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Open Connect Traffic

NETFLIX AND FREEBSDFOSDEM 2019

Video Apps

Video Apps

Video Apps

Video Apps

Open Connect

Page 6: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Netflix OCA Workload

NETFLIX AND FREEBSDFOSDEM 2019

CPU

RAM

Disks

Plain-text Data

Encrypted Data

NICs

Page 7: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Using FreeBSD and commodity parts, we achieve 90 Gb/s serving TLS-encrypted connections with ~55% CPU on a 16-core 2.6-GHz CPU.

NETFLIX AND FREEBSDFOSDEM 2019

Page 8: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

NETFLIX AND FREEBSDFOSDEM 2019

Page 9: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

NETFLIX AND FREEBSDFOSDEM 2019

OCA Operating System

Page 10: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

(Abridged) BSD “Family Tree”

NETFLIX AND FREEBSDFOSDEM 2019

BSD

AT&T Unix

NetBSD FreeBSD

Page 11: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

FreeBSD Release Cycle

NETFLIX AND FREEBSDFOSDEM 2019

head

stable/11

stable/12

12.0 12.1

11.0 11.1 11.2

?

Page 12: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

We Track FreeBSD “Head”

NETFLIX AND FREEBSDFOSDEM 2019

FreeBSD head

Netflix master

Netflix release branches

Page 13: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Typical Release Cycle

NETFLIX AND FREEBSDFOSDEM 2019

Five Weeks of Development Five Weeks of Testing/Deployment

FreeBSD Merge

Feature Development/Integration

Testing

Dev Testing

Canary Testing

Phased Rollout

Page 14: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

● NUMA enhancements● Asynchronous sendfile● Kernel TLS● Pbuf allocation enhancements● “Unmapped” mbufs● I/O scheduling● TCP algorithms● TCP logging infrastructure

Examples of Features

NETFLIX AND FREEBSDFOSDEM 2019

Page 15: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Tracking “head” lets us stayforward looking andfocused on innovation.

NETFLIX AND FREEBSDFOSDEM 2019

Page 16: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Downstream users of open-source projects can be stuck in “vicious” or “virtuous” cycles.

NETFLIX AND FREEBSDFOSDEM 2019

Page 17: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Vicious Cycle

NETFLIX AND FREEBSDFOSDEM 2019

Infrequent Merges

ManyConflicts/Regressions

SlowerFeatureVelocity

Page 18: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Virtuous Cycle

NETFLIX AND FREEBSDFOSDEM 2019

Frequent Merges

FewConflicts/Regressions

FasterFeature

Velocity/Collaboration

Page 19: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

● Information covered under NDA● Feature which is still in development/testing● Feature which needs to be generalized

Reasons We Keep Local Diffs

NETFLIX AND FREEBSDFOSDEM 2019

Page 20: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

It is our intention to upstream any code which we can.

NETFLIX AND FREEBSDFOSDEM 2019

Page 21: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

● Quicker feature iteration● Quicker access to new FreeBSD features● Quicker bug fixes● Enables collaboration● Minimizes merge conflicts● Amortizes merge “cost”

Benefits to Netflix of Tracking FreeBSD “Head”

NETFLIX AND FREEBSDFOSDEM 2019

Page 22: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

● Wide deployment of “head” branch code (albeit in a narrow use case)● Early intensive testing● Incentive for Netflix to upstream code

Benefits to FreeBSD

NETFLIX AND FREEBSDFOSDEM 2019

Page 23: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

● It isn’t stable● Why should you pay to find the bugs others will find while testing head?● Aren’t there more security bugs?● No one runs development branches● Pay monthly “cost” to do merges● You get new bugs each month

Objections to Running “Development” Code

NETFLIX AND FREEBSDFOSDEM 2019

Page 24: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Running FreeBSD “head” lets us deliver large amounts of data to our users very efficiently, while maintaining a high velocity of feature development.

NETFLIX AND FREEBSDFOSDEM 2019

Page 25: Netflix and FreeBSD: Using Open Source to Deliver ... · The Open Connect Appliance The OCA is the “backbone” of the Open Connect network. The OCA almost exclusively runs open-source

Thank you