EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux...

37
EbbRT: A Framework for Building Per- Application Library Operating Systems Dan Schatzberg, James Cadden, Han Dong, Orran Krieger, Jonathan Appavoo Boston University

Transcript of EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux...

Page 1: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

EbbRT: A Framework for Building Per-

Application Library Operating Systems

Dan Schatzberg, James Cadden, Han Dong, Orran Krieger, Jonathan AppavooBoston University

Page 2: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Lower Effort

Lower Performance

Higher Effort

Existing General Purpose Systems

Custom Special Purpose Systems

Higher Performance

Page 3: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Lower Effort

Lower Performance

Higher Effort

Higher Performance

Existing General Purpose Systems

Custom Special Purpose Systems

Ideal

Page 4: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Cloud Computing allows users to rent entire virtual machines

to run their own OS and applications

Hypervisor

Hardware

Hypervisor

Hardware

http://cdn.slashgear.com/wp-content/uploads/2012/10/google-datacenter-tech-13.jpg

Page 5: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Cloud Computing allows users to rent entire virtual machines

to run their own OS and applications

Hypervisor

Hardware

Hypervisor

Hardware

http://cdn.slashgear.com/wp-content/uploads/2012/10/google-datacenter-tech-13.jpg

The OS no longer needs to provide protection and isolation

Page 6: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)

A framework for constructing per-application Library Operating Systems in order to achieve high performance

with low effort.

Page 7: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Construct customized environments for individual applications with reusable

components.

App

Hypervisor

Hardware

Page 8: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

• Build bootable (by grub, kexec, qemu, etc.) ELF images using a modified GCC 5.3 toolchain

• Most code written in C++14 (~15kloc)

• Library of core system components

• Includes libc, libstdc++, boost libraries, and more

Implementation Details

Page 9: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)Architecture

Page 10: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)Architecture

1. Low-level, event-driven execution environment

• Allow applications to be written more directly to hardware interfaces for high performance

2. Heterogeneous distributed system architecture

• Offload functionality to general purpose operating systems for compatibility

3. Elastic Building Blocks

• Encapsulate system and application functionality in order to promote customization and reuse

Page 11: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)Architecture

1. Low-level, event-driven execution environment

• Allow applications to be written more directly to hardware interfaces for high performance

2. Heterogeneous distributed system architecture

• Offload functionality to general purpose operating systems for compatibility

3. Elastic Building Blocks

• Encapsulate system and application functionality in order to promote customization and reuse

Page 12: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)Architecture

1. Low-level, event-driven execution environment

• Allow applications to be written more directly to hardware interfaces for high performance

2. Heterogeneous distributed system architecture

• Offload functionality to general purpose operating systems for compatibility

3. Elastic Building Blocks

• Encapsulate system and application functionality in order to promote customization and reuse

Page 13: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Linux Memcached

Device Driver

InterruptNetwork

StackDevice Driver

Network Stack

Request Data

Memcached

Request Data

sk_buff

Page 14: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Linux Memcached

Device Driver

InterruptNetwork

StackDevice Driver

Network Stack

Request Data

Memcached

Schedule thread Context Switch

Request Data

sk_buff

Page 15: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Linux Memcached

Device Driver

InterruptNetwork

StackDevice Driver

Network Stack

Request Data

Memcached

Schedule thread Context Switch

Request Data

sk_buff

Copy packet to userspace

Page 16: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Linux Memcached

Device Driver

InterruptNetwork

StackDevice Driver

Network Stack

Request Data

Memcached

Schedule thread Context Switch

Request Data

sk_buff

Copy packet to userspace

Interrupts Enabled

Page 17: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Linux Memcached

Device Driver

InterruptNetwork

StackDevice Driver

Network Stack

Request Data

Memcached

Schedule thread Context Switch

Request Data

sk_buff

Copy packet to userspace

Interrupts Enabled

General purpose operating systems introduceinefficiencies for individual applications

Page 18: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

• EbbRT applications execute at highest privilege level

• Identity mapped memory with large pages

• Execution as non-preemptive events generated by hardware or software

Page 19: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

EbbRT Memcached

Device Driver

InterruptNetwork

Stack

IOBuf

Request Data

Memcached

Function CallFunction Call

Interrupts Disabled

• No paging• No complex scheduling

Zero Copy

Page 20: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.
Page 21: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

• Server running on 6 threads

• Mutilate request generator w/ 7 clients

• Facebook ETC workload

• Using TCP

Page 22: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.
Page 23: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

EbbRT Memcached is able to attain >2x throughput at SLA

Page 24: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.
Page 25: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Other BenefitsSee paper for details

• Blocking semantics

• Read-Copy-Update (RCU)

• Core-local data structures

Page 26: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)Architecture

1. Low-level execution environment

2. Heterogeneous distributed system architecture

3. Distributed object model

Page 27: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

NIC Driver

Network Processing

Interrupt

Reuse event-driven network stack to provide networking to Node.js

Page 28: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Disk Driver

Filesystem

Page 29: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Disk Driver

FilesystemAvoid duplicating functionality for

compatibility

Page 30: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Filesystem libEbbRT

Offload functionality for rapid development

Page 31: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building BlocksSystem-wide distributed objects

Representative

Filesystem Ebb

Page 32: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building BlocksSystem-wide distributed objects

Representative

Page 33: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

V8 Javascript Benchmark SuiteSp

eedu

p

Page 34: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

V8 Javascript Benchmark Suite

Higher score is better3000 new lines of code and two weeks

Spee

dup

Page 35: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Other BenefitsSee paper for details

• Distributing EbbRT as a toolchain

• Providing language and library compatibility

• Language-level primitives (Lambdas, Futures, IOBufs)

Page 36: EbbRT: A Framework for Building Per- Application Library ......Copy packet to userspace. Linux Memcached Device Driver Interrupt Network Stack Device Driver ... networking to Node.js.

Elastic Building Block Runtime (EbbRT)

• Low-level execution environment enables applications to get much closer to the hardware

• Heterogeneous distributed system allows for functionality offload for incremental development

• Distributed object model encapsulates functionality, enabling customization and reuse