SEDA An architecture for Well-Conditioned, scalable Internet Services Matt Welsh, David Culler, and Eric Brewer University of California, Berkeley Symposium.

Slides:



Advertisements
Similar presentations
Scheduling in Web Server Clusters CS 260 LECTURE 3 From: IBM Technical Report.
Advertisements

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,
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
IO-Lite: A Unified Buffering and Caching System By Pai, Druschel, and Zwaenepoel (1999) Presented by Justin Kliger for CS780: Advanced Techniques in Caching.
1 SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
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.
1 Routing and Scheduling in Web Server Clusters. 2 Reference The State of the Art in Locally Distributed Web-server Systems Valeria Cardellini, Emiliano.
Technical Architectures
Concurrency, Thread and Event CS6410 Sept 6, 2011 Ji-Yong Shin.
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
Understanding Networked Applications: A First Course Chapter 17 by David G. Messerschmitt.
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.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
Computer Science Scalability of Linux Event-Dispatch Mechanisms Abhishek Chandra University of Massachusetts Amherst David Mosberger Hewlett Packard Labs.
3.5 Interprocess Communication
Chapter 13 Embedded Systems
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.
Lecture 8 Epidemic communication, Server implementation.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
SEDA – Staged Event-Driven Architecture
Apache Architecture. How do we measure performance? Benchmarks –Requests per Second –Bandwidth –Latency –Concurrency (Scalability)
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
LiNK: An Operating System Architecture for Network Processors Steve Muir, Jonathan Smith Princeton University, University of Pennsylvania
M i SMob i S Mob i Store - Mobile i nternet File Storage Platform Chetna Kaur.
Pattern Oriented Software Architecture for Networked Objects Based on the book By Douglas Schmidt Michael Stal Hans Roehnert Frank Buschmann.
Adaptive Overload Control for Busy Internet Servers Matt Welsh and David Culler USENIX Symposium on Internet Technologies and Systems (USITS) 2003 Alex.
CHEN Ge CSIS, HKU March 9, Jigsaw W3C’s Java Web Server.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Presented by Changdae Kim and Jaeung Han OFFENCE.
Scalable Web Server on Heterogeneous Cluster CHEN Ge.
Advanced Network Architecture Research Group 2001/11/74 th Asia-Pacific Symposium on Information and Telecommunication Technologies Design and Implementation.
Computer Science 1 Adaptive Overload Control for Busy Internet Servers Matt Welsh and David Culler USITS 2003 Presented by: Bhuvan Urgaonkar.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
OPERATING SYSTEM SUPPORT DISTRIBUTED SYSTEMS CHAPTER 6 Lawrence Heyman July 8, 2002.
Distributed Information Systems. Motivation ● To understand the problems that Web services try to solve it is helpful to understand how distributed information.
Empirical Quantification of Opportunities for Content Adaptation in Web Servers Michael Gopshtein and Dror Feitelson School of Engineering and Computer.
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.
Intel Research & Development ETA: Experience with an IA processor as a Packet Processing Engine HP Labs Computer Systems Colloquium August 2003 Greg Regnier.
1 Combining Events and Threads for Scalable Network Services Peng Li and Steve Zdancewic University of Pennsylvania PLDI 2007, San Diego.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
Measuring the Capacity of a Web Server USENIX Sympo. on Internet Tech. and Sys. ‘ Koo-Min Ahn.
CSC Multiprocessor Programming, Spring, 2012 Chapter 11 – Performance and Scalability Dr. Dale E. Parson, week 12.
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
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.
CS533 Concepts of Operating Systems Jonathan Walpole.
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
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.
Lecture 4 Page 1 CS 111 Summer 2013 Scheduling CS 111 Operating Systems Peter Reiher.
Capriccio:Scalable Threads for Internet 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
Presentation by Omar Abu-Azzah
Capriccio – A Thread Model
Why Events Are a Bad Idea (for high concurrency servers)
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
Presentation transcript:

SEDA An architecture for Well-Conditioned, scalable Internet Services Matt Welsh, David Culler, and Eric Brewer University of California, Berkeley Symposium on Operating Systems Principles (SOSP), October Presented by: Disha Gandhi

Outline Why SEDA ?? What is SEDA ?? Thread and Event-based Concurrency SEDA Architecture Asynchronous I/O Primitives Applications and Performance Evaluation 2

Motivation for SEDA Prototypical application: web server Requirements for internet services – Need high level concurrency. – Handle huge variations in load (Slashdot effect) – Handle new system designs to manage these loads challenges – dynamic content, hosting of services on general-purpose servers. Well-conditioned service: simple pipeline without degradation beyond load saturation 3

What is SEDA??? From Matt Welsh’s PhD work at Berkeley ( ) A design for highly concurrent server applications Combines elements of both thread and event- based programming Dynamic resource control mechanisms for automatic tuning and load conditioning to handle large fluctuations in load 4

Thread based concurrency model Thread per-request model (commonly used design for server applications) Synchronization protects shared resources OS overlaps computation and I/O by transparently switching among threads. Cache/TLB misses, threads scheduling, lock contention overheads. 5

Thread-server performance degradation High load - high context overhead. Throughput decreases Response time very high as task queue length increases Not good for concurrency requirements of Internet 6

Bounded Thread Pools To avoid overuse of threads, bind the size of thread pool. Reject additional connections. Common solution (Apache etc) Throughput, overall performance better But : is it fair to clients? How to determine upper limit? Difficult to identify internal performance bottlenecks. 7

Pipeline Model Of Computation 8

Event-driven concurrency Small number of threads (typically one per CPU) that loop continuously, processing events from a queue. Events-handlers should be short-lived. I/O must be non-blocking. 9

Performance Robust to load Throughput constant Latency linear. 10

Problems with Event-driven Scheduling and overhead of events Choice of scheduling algorithm is tailored to application. No principled framework, so solutions are typically ad-hoc, lacking modularity “Structured Event queues” to improve code modularity and simplify application design. 11

Staged Event-Driven Architecture Application decomposed into independent stages separated by queues. Supports massive concurrency: each stage has own thread pool Self-contained application components– event handler, incoming event queue and thread pool – clean boundary for modularity/security and introspection. (at cost of increased latency) Finite event queues can provide: backpressure: blocking on a full queue load shedding: dropping events errors to user, etc. 12

Anatomy of a Stage Self-contained application components. Application-supplied event handler Controller dynamically adjusts resource allocation. Small number of threads per stage 13

Dynamic Resource Controller Adjusts batching factor to increase throughput while maintaining cache optimization and task aggregation 14  Automatically adapt the resource usage of a stage  based on observed performance and demand Adjust number of threads allocated to stage based on actual measured usage

Using Asynchronous I/O Primitives Asynchronous socket I/O Uses non-blocking I/O provided by OS for services. Asynchronous file I/O Uses blocking I/O and a bounded threaded pool. 15

Comparison SEDA based layer: non- blocking I/O by OS and /dev/poll event-driven mechanism : ~constant I/O bandwidth Compatibility layer that uses blocking sockets and a thread pool: thread thrashing 16

Sandstorm: A SEDA Prototype Entirely in java Native libraries for non-blocking socket I/O Automated memory management to garbage-collecting expired events. Each application module implements a simple event handler interface with a single method call which processes a batch of events pulled from stages’s incoming event queue. Run-time system and associated controllers create threads. API’s for naming, creating and destroying stages, and other functions. Socket and file I/O mechanisms as standard interfaces. 17

Haboob : SEDA Web server More complicated web server: 10 stages, 4 for asynchronous socket and disk I/O. HttpParse stage: accept new client connections. HttpRecv stage: accept HTTP connection and request events and pass to PageCache stage or generate response directly PageCache: in-memory Web page cache using hashtable indexed by URL Cachemiss: handle page cache misses, using asynchronus file I/O to read from disk HttpSend: send response to client, statistics gathering High modularity 18

Performance Comparison Throughput stable at high loads for all, though Haboob is the best. Apache and Flash have huge variation in response time (long tails) Haboob has low variation in response time, but has longer average response time Haboob has graceful degradation, apache fairness decline quickly after its limit of number of connections. 19

Results: Resource Throttling clients repeatedly request dynamic pages with I/O and computation Apache and Haboob (with no control) process all requests, Flash rejects some due to a bug in its code. Haboob controller drops (with error) if average response time > 5 sec

Gnutella packet router Use of SEDA for non-traditional Internet services. Routing packets in a peer to peer file sharing network 3 stages in SEDA implementation: GnutellaServer, GneutellaRouter and Gneutellacatcher 21

Summary SEDA provides a framework for web services ( handle massive concurrency and huge variations in load). Combined approach tries to achieve performance, with flexibility and ease of programming. SEDA uses dynamic controllers for resource usage and scheduling at each stage. Robust performance as per published results. 22

Current state of SEDA “a number of recent research papers have demonstrated that the SEDA prototype (in Java) performs poorly compared to threaded or event-based systems implemented in C” “The most fundamental aspect of the SEDA architecture is the programming model that supports stage-level backpressure and load management. Our goal was never to show that SEDA outperforms other server designs, but rather that acceptable performance can be achieved while providing a disciplined apporach to overload management. Clearly more work is needed to show that this goal can be met in a range of application and server environments.” 23

Acknowledgement a/. a/ Previous class presentations. 24