1 Capriccio: Scalable Threads for Internet Services Matthew Phillips.

Slides:



Advertisements
Similar presentations
Threads Relation to processes Threads exist as subsets of processes Threads share memory and state information within a process Switching between threads.
Advertisements

Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
Chess Review May 8, 2003 Berkeley, CA Compiler Support for Multithreaded Software Jeremy ConditRob von Behren Feng ZhouEric Brewer George Necula.
CHAPTER 5 THREADS & MULTITHREADING 1. Single and Multithreaded Processes 2.
CS533 Concepts of Operating Systems Jonathan Walpole.
Threads Irfan Khan Myo Thein What Are Threads ? a light, fine, string like length of material made up of two or more fibers or strands of spun cotton,
Why Events Are A Bad Idea (for high-concurrency servers) By Rob von Behren, Jeremy Condit and Eric Brewer.
Threads. Announcements Cooperating Processes Last time we discussed how processes can be independent or work cooperatively Cooperating processes can.
Capriccio: Scalable Threads for Internet Services ( by Behren, Condit, Zhou, Necula, Brewer ) Presented by Alex Sherman and Sarita Bafna.
Capriccio: Scalable Threads for Internet Services (von Behren) Kenneth Chiu.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, George Necula and Eric Brewer University of California at Berkeley.
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.
Threads 1 CS502 Spring 2006 Threads CS-502 Spring 2006.
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]
“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,
Threads. Processes and Threads  Two characteristics of “processes” as considered so far: Unit of resource allocation Unit of dispatch  Characteristics.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer Computer Science Division, University of California.
Chapter 51 Threads Chapter 5. 2 Process Characteristics  Concept of Process has two facets.  A Process is: A Unit of resource ownership:  a virtual.
Why Events Are A Bad Idea (for high-concurrency servers) Rob von Behren, Jeremy Condit and Eric Brewer Presented by: Hisham Benotman CS533 - Concepts of.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services
1 From Processes to Threads. 2 Processes, Threads and Processors Hardware can interpret N instruction streams at once  Uniprocessor, N==1  Dual-core,
Operating System Principles Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh.
Threads, Thread management & Resource Management.
Introduction to Threads CS240 Programming in C. Introduction to Threads A thread is a path execution By default, a C/C++ program has one thread called.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Presented by Changdae Kim and Jaeung Han OFFENCE.
1 Processes, Threads, Race Conditions & Deadlocks Operating Systems Review.
Capriccio: Scalable Threads for Internet Services Rob von Behren, Jeremy Condit, Feng Zhou, Geroge Necula and Eric Brewer University of California at Berkeley.
CS333 Intro to Operating Systems Jonathan Walpole.
1 Combining Events and Threads for Scalable Network Services Peng Li and Steve Zdancewic University of Pennsylvania PLDI 2007, San Diego.
Lecture 5: Threads process as a unit of scheduling and a unit of resource allocation processes vs. threads what to program with threads why use threads.
5204 – Operating Systems Threads vs. Events. 2 CS 5204 – Operating Systems Forms of task management serial preemptivecooperative (yield) (interrupt)
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 4: Threads.
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.
CSE 60641: Operating Systems Next topic: CPU (Process/threads/scheduling, synchronization and deadlocks) –Why threads are a bad idea (for most purposes).
1 Cooperative Task Management without Manual Stack Management or Event-driven Programming is not the Opposite of Threaded Programming Atul Adya, Jon Howell,
Capriccio: Scalable Threads for Internet Service
By: Rob von Behren, Jeremy Condit and Eric Brewer 2003 Presenter: Farnoosh MoshirFatemi Jan
Holistic Systems Programming Qualifying Exam Presentation UC Berkeley, Computer Science Division Rob von Behren June 21, 2004.
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 A thread is an alternative model of program execution
An Efficient Threading Model to Boost Server Performance Anupam Chanda.
CS533 Concepts of Operating Systems Jonathan Walpole.
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.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
Silberschatz, Galvin and Gagne ©2009Operating System Concepts – 8 th Edition Chapter 4: Threads.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
Capriccio:Scalable Threads for Internet Services
Chapter 4: Threads.
SEDA: An Architecture for Scalable, Well-Conditioned Internet Services
Capriccio : Scalable Threads for Internet Services
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Why Events Are A Bad Idea (for high-concurrency servers)
CS399 New Beginnings Jonathan Walpole.
Presenter: Godmar Back
Capriccio – A Thread Model
Chapter 4: Threads.
Chapter 4: Threads.
CHAPTER 4:THreads Bashair Al-harthi OPERATING SYSTEM
Multithreaded Programming
Capriccio: Scalable Threads for Internet Services
Why Threads Are A Bad Idea (for most purposes)
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)
CS 5204 Operating Systems Lecture 5
Threads.
Presentation transcript:

1 Capriccio: Scalable Threads for Internet Services Matthew Phillips

2 Overview Motivation Background History Threads vs. event based systems User-level threads vs. kernel threads Capriccio Linked stacks Resource-aware scheduler Evaluation

3 Motivation High concurrency Internet servers can have requests for hundreds of thousands of connections. Simplify programming model.

4 Background History Why threads are a bad idea (for most purposes), John Ousterhout. Sun Labs Race conditions, deadlocks, not scalable, etc. Popularity of Internet about the same time Heavy demand on web servers

5 Background History Need for high concurrency servers Flash SEDA Interest in systems other than thread based systems. Event based systems Problem: Event based systems are sometimes difficult to use. Programmers prefer linear program control

6 Background History Instead of making event based systems more usable, “fix” thread based systems. Investigate ways to make thread based systems more scalable. Authors presented Why events are a bad idea (for high-concurrency servers) On the duality of operating system structures, Lauer, Needham.1978.

7 Background Why threads? Can have equal or better performance More desirable programming model Programmers prefer linear program control Existing systems use threads

8 Background Kernel threads Systems calls open, read, send, receive User-level threads User-level libraries

9 Background User-level threads Advantages: Flexibility: A level away (abstraction) from kernel. Decouples applications and kernel. Performance: User-level threads are lightweight: Inexpensive synchronization, fast context switches Thus, user-level threading is used.

10 Background Created user-level threading library for Linux All thread operations are O(1) Now scalable

11 Capriccio Linked stacks Traditional call stacks LinuxThreads allocates 2 megabytes per thread Most threads only consume a few kilobytes Lots of wasted virtual memory 32 bit system has 4 gigabyte limit

12 Capriccio Uses weighted call graphs Perform a whole-program analysis CIL used to read source Each function is a node Each edge is a function call Node weights are calculated from stack frames

13 Capriccio Node weights int sample() { int a, b; int c[10]; double d; char e[8036]; return 0; }

14 Capriccio Example Path from Main->A->B is 2.3k

15 Capriccio Example main(){char buf[512]; A(); C();} void A(){char buf[820]; B(); D();} void B(){char buf[1024];} void C(){char buf[205]; D(); E();} void D(){char buf[205];} void E(){char buf[205]; C();}

16 Capriccio Linked stacks Recursion complicates things Use checkpoints to deal with recursion

17 Capriccio Placement of checkpoints Break each cycle with checkpoint Additional checkpoints Longest path from node to checkpoint, if predefined limit is exceeded, add checkpoint

18 Capriccio Example

19 Capriccio Resource aware scheduling Uses blocking graph Node is location in program that is blocked Node is composed of call chain used to reach blocking point

20 Capriccio Resource aware scheduling Edges are annotated with average running time - time it took the thread to pass between nodes Nodes are annotated with resources used on its outgoing edges.

21 Capriccio Resource aware scheduling

22 Capriccio Evaluation Apache Compared with Knot Compared with Haboob

23 Capriccio Evaluation 15% speedup with Capriccio