CS533 Concepts of Operating Systems Jonathan Walpole.

Slides:



Advertisements
Similar presentations
50.003: Elements of Software Construction Week 10 Thread Pool.
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,
Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.
1 SEDA: An Architecture for Well- Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University.
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.
Computer Science Lecture 6, page 1 CS677: Distributed OS Processes and Threads Processes and their scheduling Multiprocessor scheduling Threads Distributed.
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.
CS533 Concepts of Operating Systems Class 5 Event-Based Systems.
“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.
CS533 Concepts of Operating Systems Class 2 The Duality of Threads and Events.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
SEDA – Staged Event-Driven Architecture
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
Flash An efficient and portable Web server. Today’s paper, FLASH Quite old (1999) Reading old papers gives us lessons We can see which solution among.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Rapid Development of High Performance Servers Khaled ElMeleegy Alan Cox Willy Zwaenepoel.
Scalable Kernel Performance for Internet Servers under Realistic Loads. Gaurav Banga, etc... Western Research Lab : Research Report 1998/06 (Proceedings.
Copyright ©: University of Illinois CS 241 Staff1 Threads Systems Concepts.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
Middleware Services. Functions of Middleware Encapsulation Protection Concurrent processing Communication Scheduling.
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)
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.
Department of Computer Science and Software Engineering
LAIO: Lazy Asynchronous I/O For Event Driven Servers Khaled Elmeleegy Alan L. Cox.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
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.
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
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!
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.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
Node.Js Server Side Javascript
Process concept.
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Advanced Topics in Concurrency and Reactive Programming: Asynchronous Programming Majeed Kassis.
Processes and Threads Processes and their scheduling
CS399 New Beginnings Jonathan Walpole.
Chapter 4: Multithreaded Programming
Node.Js Server Side Javascript
Capriccio – A Thread Model
CS510 Operating System Foundations
TDC 311 Process Scheduling.
CS533 Concepts of Operating Systems Class 7
Why Threads Are A Bad Idea (for most purposes)
CS510 Operating System Foundations
Why Events Are a Bad Idea (for high concurrency servers)
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
CS703 – Advanced Operating Systems
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
CSC Multiprocessor Programming, Spring, 2011
Presentation transcript:

CS533 Concepts of Operating Systems Jonathan Walpole

SEDA: An Architecture for Well- Conditioned Scalable Internet Services

Overview What does well-conditioned mean? Internet service architectures -thread per request -thread pools - event driven The SEDA architecture Evaluation

Internet Services Wide variation in Internet load -the slashdot effect Wide variation in service requirements -must support static and dynamic content -with responsiveness and high availability Resource management challenge -supporting massive concurrency at a low cost

Well-Conditioned Services A well-conditioned service will not bog down under heavy load! As load increases response time should increase linearly Well-conditioned services require the right architectural approach SEDA = Staged Event-Driven Architecture

Architectural Alternatives 1. Thread per request architecture 2. Thread pool architecture 3. Event driven architecture

Thread Per Request Create a new thread for each request Delete thread when request is complete Thread blocks during I/O Standard approach in RPC, Java RMI, DCOM

Super Market Analogy Hire a checkout clerk when a customer enters the store Fire the checkout clerk when the customer leaves the store Is this implementation of a super market service well-conditioned? How could we do better?

Does This Work for Web Servers?

Why Does This Happen? Despite being easy to program, this approach suffers from: -excessive delay for thread creation -overhead of thread destruction -premature thrashing of CPU, memory, and cache, when load gets high - high context switch overhead - high memory costs for thread stack and TCB

Thread Pools Very similar structure, except -the number of threads is bounded -threads are created statically -threads are recycled after use -requests delayed when all threads in use Standard approach in Apache, IIS, Netscape ES, BEA Weblogic, IBM WebSphere, etc

Super Market Analogy Hire N permanent checkout clerks - each customer is assigned to a clerk - M clerks per cash register - clerks may need to queue to use register How does this approach perform during normal load and during overload? What happens if a customer has an unusual request?

Thread Pool Performance Mixed workloads can result in unfair delays Its difficult to identify problems or sources of bottlenecks when all threads look alike Its difficult to know how big the thread pool should be

The Event-Driven Approach Request arrival is an event Events are handled by the execution of a function - an event handler Event handlers are run sequentially and non-preemptively - using one thread per CPU

Super Market Analogy One checkout clerk per cash register Customers queue waiting for clerk Clerk completes work for one customer before starting work for the next Bottlenecks are easy to identify and fix -customer queues get too long at the problem register -customers can be moved from one queue to another

Does This Work for a Web Server?

Event Driven Architectures What is good about them? - Robust in the face of load variation - High throughput - Potential for fine grain control

Event Driven Architectures Used in Flash, thttpd, Zeus, JAW, and Harvest SEDA extends the idea to expose load-related information and to simplify and automate dynamic load balancing and load shedding

SEDA’s Building Block – Stage

Stages Connected by Event Queues Event queues define the control boundaries and can be inspected!

Dynamic Resource Controllers

Thread Pool Controller Performance

Batching Controller Performance

Adaptive Load Shedding

Asynchronous I/O You need asynchronous I/O but its not always available form the OS! Asynchronous socket I/O - non-blocking socket calls used in readStage, writeStage, and listenStage Asynchronous file I/O - asynchronous file calls not available - had to fake it using a thread pool

Haboob HTTP Server

Gnutella Packet Router

Conclusion The SEDA approach works well - it supports high concurrency - it is easy to program and tune - services are well-conditioned - introspection and self-tuning are supported