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

Slides:



Advertisements
Similar presentations
CS 443 Advanced OS Fabián E. Bustamante, Spring 2005 Resource Containers: A new Facility for Resource Management in Server Systems G. Banga, P. Druschel,
Advertisements

Helper Threads via Virtual Multithreading on an experimental Itanium 2 processor platform. Perry H Wang et. Al.
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.
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 Services ( by Behren, Condit, Zhou, Necula, Brewer ) Presented by Alex Sherman and Sarita Bafna.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
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 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.
Virtual Memory Chapter 8.
Web Server Software Architectures Author: Daniel A. Menascé Presenter: Noshaba Bakht.
CS533 Concepts of Operating Systems Class 2 Thread vs Event-Based Programming.
Concurrency, Threads, and Events Robbert van Renesse.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
SEDA – Staged Event-Driven Architecture
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
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
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts - 7 th Edition, Feb 7, 2006 Process Concept Process – a program.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
© Lindsay Bradford1 Scaling Dynamic Web Content Provision Using Elapsed-Time- Based Content Degradation Lindsay Bradford, Stephen Milliner and.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
1 Multiprocessor and Real-Time Scheduling Chapter 10 Real-Time scheduling will be covered in SYSC3303.
Rapid Development of High Performance Servers Khaled ElMeleegy Alan Cox Willy Zwaenepoel.
1 Scheduling The part of the OS that makes the choice of which process to run next is called the scheduler and the algorithm it uses is called the scheduling.
U NIVERSITY OF M ASSACHUSETTS A MHERST Department of Computer Science Computer Systems Principles Concurrency Patterns Emery Berger and Mark Corner University.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Computer Science 1 Adaptive Overload Control for Busy Internet Servers Matt Welsh and David Culler USITS 2003 Presented by: Bhuvan Urgaonkar.
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
Operating Systems CSE 411 CPU Management Sept Lecture 10 Instructor: Bhuvan Urgaonkar.
Measuring the Capacity of a Web Server USENIX Sympo. on Internet Tech. and Sys. ‘ Koo-Min Ahn.
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.
SEDA An architecture for Well-Conditioned, scalable Internet Services Matt Welsh, David Culler, and Eric Brewer University of California, Berkeley Symposium.
Martin Kruliš by Martin Kruliš (v1.1)1.
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.
An Efficient Threading Model to Boost Server Performance Anupam Chanda.
 Process Concept  Process Scheduling  Operations on Processes  Cooperating Processes  Interprocess Communication  Communication in Client-Server.
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.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
for Event Driven Servers
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.
Multithreading vs. Event Driven in Code Development of High Performance Servers.
Introduction to Operating Systems Concepts
Processes and threads.
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)
Chapter 3: Process Concept
Copyright ©: Nahrstedt, Angrave, Abdelzaher
Chapter 4: Multithreaded Programming
Capriccio – A Thread Model
Chapter 4: Processes Process Concept Process Scheduling
Lecture 2: Processes Part 1
Chapter 15, Exploring the Digital Domain
Process & its States Lecture 5.
Operating System Concepts
CS533 Concepts of Operating Systems Class 7
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
CSC Multiprocessor Programming, Spring, 2011
Presentation transcript:

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

2 An Application for:  servicing requests for Internet services  servicing a load (demand) that is never constant  providing a service that scales to load  keep in mind these issues of scalability:  load fluctuates, sometimes wildly  you only want to allot the resources servicing the load requires  every system has a limit! Scale responsibly!  don’t over commit the system SEDA

3 Design Goals:  service requests for BOTH static content AND dynamic content  demand for dynamic content is increasing  work to deliver static content is predictable  retrieve the static content from disk or cache  send it back on the network SEDA

4 Design Goals:  work to deliver dynamic content is unknown  build content on the fly  how many I/Os to retrieve the content?  layout, insert, and format content  may require substantial computation  posing queries of a database and incorporating results  all the more reason to scale to load! SEDA

5 Design Goals:  adaptive service logic  different levels of load require different service strategies for optimum response  load is determined by BOTH the number of requests for service and the work the server must do to answer them  platform independence by adapting to resources available  load is load, no matter what your system is SEDA

6 Consider (just) Using Threads:  the ‘model’ of concurrency  two ways to just use threads for servicing internet requests:  unbounded thread allocation  bounded thread pool (Apache)  hint: remember !!  (somewhat different reasons though!) SEDA Threads!

7 Consider (just) Using Threads:  unbounded thread allocation  issues thread per request  too many use up all the memory  scheduler ‘thrashes’ between them, CPU spends all its time in context switches  bounded thread pool  works great until every thread is busy  requests that come in after suffer unpredictable waits --> ‘unfairness’ SEDA

8 Consider (just) Using Threads:  transparent resource virtualization (!)  fancy term for the virtual environment threads/processes run in  threads believe they have everything to themselves, unaware of constraint to share resources  t. r. v. = delusions of grandeur!  no participation in system resource management decisions, no indication of resource availability to adapt its own service logic SEDA

9 DON’T Consider Using Threads! SEDA  threaded server throughput degradation  as the number of threads spawned by the system rises, the ability of the system to do work declines  throughput goes down, latency goes up

10 Consistent Throughput is KEY:  well-conditioned service:  sustain throughput by acting like a pipeline  break down servicing of requests into stages  each stage knows its limits and does NOT over provision  so maximum throughput is a constant no matter the varying degree of load  if load exceeds capacity of the pipeline, requests get queued and wait their turn. So latency goes up, but throughput remains the same. SEDA

11 Opaque Resource Allocation:  incorporate Event-Driven Design in the pipeline  remember -- only one thread!  no context switch overhead  paradigm allows for adaptive scheduling decisions  adaptive scheduling and responsible resource management are the keys to maintaining control and not over-committing resources to account for unpredictable spikes in load SEDA

12 Back to the argument:  Event-driven Programming vs. Using Threads  the paper recommends event-driven design as the key to effective scalability, yet it certainly doesn’t make it sound as easy as Ousterhout  event handlers as finite state machines  scheduling and ordering of events ‘all in the hands’ of the application developer  certainly looks at the more complex side of event-driven programming SEDA

13 Anatomy of SEDA:  Staged Event Driven Architecture  a network of stages  one big event becomes series of smaller events  improves modularity and design  event queues  managed separately from event handler  dynamic resource controllers (it’s alive!)  allow apps to adjust dynamically to load  culmination is a managed pipeline SEDA

14 Anatomy of SEDA:  a queue before each stage  stages queue events for other stages  note the modularity  biggest advantage is that each queue can be managed individually SEDA

15 Anatomy of a Stage:  event handler  code is provided by application developer  incoming event queue  for portions of requests handled by each stage  thread pool  threads dynamically allocated to meet load on the stage  controller  oversees stage operation, responds to changes in load, locally and globally SEDA

16 Anatomy of a Stage:  thread pool controller manages the allocation of threads. Number is determined by length of queue  batching controller determines the number of events to process in each invocation of the handler SEDA

17 Asynchronous I/O:  SEDA provides two asynchronous I/O primitives  asynchronous = non-blocking  asynchronous socket I/O  intervenes between sockets and application  asynchronous file I/O  intervenes to handle file I/O for application  different in implementation, but design of each uses event-driven semantics SEDA

18 Performance:  througput is sustained! SEDA

19 Summary:  load is unpredictable  most efficient use of resources is to scale to load without over committing  system resources must be managed dynamically and responsibly  staged network design culminates in a well- conditioned pipeline that manages itself  event-driven design for appropriate scalability  threads are used in stages when possible SEDA