SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.

Slides:



Advertisements
Similar presentations
1 SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
Advertisements

CS533 Concepts of Operating Systems Jonathan Walpole.
SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
Concurrency, Thread and Event CS6410 Sept 6, 2011 Ji-Yong Shin.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
1 Principles of Reliable Distributed Systems Tutorial 12: Frangipani Spring 2009 Alex Shraer.
Understanding Networked Applications: A First Course Chapter 17 by David G. Messerschmitt.
Capriccio: Scalable Threads for Internet Services ( by Behren, Condit, Zhou, Necula, Brewer ) Presented by Alex Sherman and Sarita Bafna.
490dp Synchronous vs. Asynchronous Invocation Robert Grimm.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
Capriccio: Scalable Threads For Internet Services Authors: Rob von Behren, Jeremy Condit, Feng Zhou, George C. Necula, Eric Brewer Presentation by: Will.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
Computer Science Scalability of Linux Event-Dispatch Mechanisms Abhishek Chandra University of Massachusetts Amherst David Mosberger Hewlett Packard Labs.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
Why Events Are a Bad Idea (for high-concurrency servers) Author: Rob von Behren, Jeremy Condit and Eric Brewer Presenter: Wenhao Xu Other References: [1]
Chapter 13 Embedded Systems
Computer Science Lecture 2, page 1 CS677: Distributed OS Last Class: Introduction Distributed Systems – A collection of independent computers that appears.
“Why Events are a Bad Idea (For high-concurrency servers)” Paper by Rob von Behren, Jeremy Condit and Eric Brewer, May 2003 Presentation by Loren Davis,
CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming.
Concurrency, Threads, and Events Robbert van Renesse.
CS533 Concepts of Operating Systems Class 2 The Duality of Threads and Events.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
SEDA – Staged Event-Driven Architecture
Client/Server Architectures
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services by, Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
Parallel Programming Models Jihad El-Sana These slides are based on the book: Introduction to Parallel Computing, Blaise Barney, Lawrence Livermore National.
Adaptive Overload Control for Busy Internet Servers Matt Welsh and David Culler USENIX Symposium on Internet Technologies and Systems (USITS) 2003 Alex.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Presented by Changdae Kim and Jaeung Han OFFENCE.
Orbited Scaling Bi-directional web applications A presentation by Michael Carter
Rapid Development of High Performance Servers Khaled ElMeleegy Alan Cox Willy Zwaenepoel.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Concurrency Patterns Emery Berger and Mark Corner University.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Computer Science 1 Adaptive Overload Control for Busy Internet Servers Matt Welsh and David Culler USITS 2003 Presented by: Bhuvan Urgaonkar.
Distributed Information Systems. Motivation ● To understand the problems that Web services try to solve it is helpful to understand how distributed information.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
CSC Multiprocessor Programming, Spring, 2012 Chapter 11 – Performance and Scalability Dr. Dale E. Parson, week 12.
Presenting: Why Events Are A “Bad” Idea ( for high-concurrency servers) Paper by: Behren, Condit and Brewer, 2003 Presented by: Rania Elnaggar 1/30/2008.
6.894: Distributed Operating System Engineering Lecturers: Frans Kaashoek Robert Morris
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
Capriccio: Scalable Threads for Internet Service
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
SEDA An architecture for Well-Conditioned, scalable Internet Services Matt Welsh, David Culler, and Eric Brewer University of California, Berkeley Symposium.
Threads versus Events CSE451 Andrew Whitaker. This Class Threads vs. events is an ongoing debate  So, neat-and-tidy answers aren’t necessarily available.
1 Why Events Are A Bad Idea (for high-concurrency servers) By Rob von Behren, Jeremy Condit and Eric Brewer (May 2003) CS533 – Spring 2006 – DONG, QIN.
Threads. Readings r Silberschatz et al : Chapter 4.
CS533 Concepts of Operating Systems Jonathan Walpole.
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise.
Paper Review of Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer By Anandhi Sundaram.
SEDA. How We Got Here On Tuesday we were talking about Multics and Unix. Fast forward years. How has the OS (e.g., Linux) changed? Some of Multics.
Distributed Handler Architecture (DHArch) Beytullah Yildiz Advisor: Prof. Geoffrey C. Fox.
Lecture 4 Page 1 CS 111 Summer 2013 Scheduling CS 111 Operating Systems Peter Reiher.
Multithreading vs. Event Driven in Code Development of High Performance Servers.
Capriccio:Scalable Threads for Internet Services
Optimizing Distributed Actor Systems for Dynamic Interactive Services
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Why Events Are A Bad Idea (for high-concurrency servers)
Processes and Threads Processes and their scheduling
Capriccio – A Thread Model
Operating Systems.
Software models - Software Architecture Design Patterns
CS533 Concepts of Operating Systems Class 7
Why Events Are a Bad Idea (for high concurrency servers)
Chapter 2 Operating System Overview
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
CSC Multiprocessor Programming, Spring, 2011
Presentation transcript:

SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of California, Berkeley Symposium on Operating Systems Principles (SOSP), October

2 Motivation Prototypical application: Web server Must handle “Slashdot effect” gracefully Well-conditioned service: simple pipeline with gaceful degradation beyond load saturation

3 Anatomy of a simple HTTP server Source: Finite state machine (FSM) Can be implemented using threads or events (or SEDA)

4 Thread-based concurrency Create thread per task Straightforward to program I/O concurrency implicitly handled – thread state captures FSM state during blocking

5 Threaded server degradation Doesn't scale well due to context overhead at high load Throughput decreases Latency curve worse than linear Thrashing – more time spent on system overhead than real work

6 Bounded Thread Pool Limit the number of threads Make requests wait for a thread to become available or reject additional connections Common solution (Apache, IIS, Netscape Server, etc.) BUT:  How to determine the number of threads to use?  Unfair at load saturation: long waiting times  Difficult to profile and tune

7 Event-based model FSM structured as sequence of event handlers Single thread run event handlers I/O must be non-blocking FSM state must be explicitly recorded across I/O events

8 Event-based performance Throughput is constant, latency is linear with number of tasks Why better performance?  No virtualization of resource management  Lighter-weight contexts  Application has control of scheduling instead of OS

9 Disadvantages of events More difficult to program:  Need to maintain state throughout FSM  Need to manage continuations across I/O  Application responsible for explicit control of scheduling No principled framework, so solutions are typically ad- hoc, lacking modularity SEDA claims to be the first to offer general-purpose architecture

10 Staged Event-Drive Architecture (SEDA)‏ Source: Decompose applications into independent stages Separate stages by queues Each stage has its own thread pool for concurrent execution Queues provide clean boundary for modularity, security and profile analysis/introspection (at cost of increased latency)

11 Staged Event-Drive Architecture (SEDA)‏ Source: Finite event queues can provide:  backpressure: blocking on a full queue  load shedding: dropping events  errors to user, etc.

12 A SEDA Stage Modular application component Event queue and thread pool managed by SEDA machinery, Parameterized by application Controller dynamically adjusts resource allocation (optionally) Application-supplied event handler

13 Dynamic Resource Controllers  Automatic, adaptive performance tuning  No programmer intervention necessary Dynamically adjust number of threads allocated to stage based on actual measured usage Process variable number of requests during each time-step, for cache optimization and task aggregation

14 Asynchronous I/O Usage of event queues requires asynchronous I/O When OS provides asynchronous I/O, SEDA provides a natural wrapper layer for applications to use (example: socket I/O) If the OS only provides blocking file I/O, need to explicitly create a stage with a bounded thread pool

15 Asynchronous I/O Performance asyncSocket layer Uses non-blocking /dev/poll Performance compared to blocking sockets and thread pool

16 Results: “Haboob” SEDA Web Server More complicated Web server, broken into stages Compared to Apache (150 static processes) and Flash (event- based)

17 Results: “Haboob” SEDA Web Server Note decline in fairness for Apache While having high frequency of low response times, note heavy tail (with long response times) for Apache and Flash

18 Results: Resource Throttling 1024 clients repeatedly request dynamic pages with I/O and computation Apache and vanilla Haboob process all requests, Flash quietly drops Haboob controller drops (with error) if average response time > 5 sec

19 Summary SEDA provides a principled framework for implementing highly concurrent event-based Web services Based on the published results, it has robust performance, especially at saturation Provides opportunities for both manual and automatic tuning