1 Mor Harchol-Balter Carnegie Mellon University School of Computer Science.

Slides:



Advertisements
Similar presentations
1 SLA Enforcement in the Service Cloud Anja Grünheid Fakultät für Informatik Lehrstuhl III - Datenbanksysteme.
Advertisements

CPU Scheduling Questions answered in this lecture: What is scheduling vs. allocation? What is preemptive vs. non-preemptive scheduling? What are FCFS,
CPU Scheduling CPU Scheduler Performance metrics for CPU scheduling
Scheduling. Main Points Scheduling policy: what to do next, when there are multiple threads ready to run – Or multiple packets to send, or web requests.
1 Size-Based Scheduling Policies with Inaccurate Scheduling Information Dong Lu *, Huanyuan Sheng +, Peter A. Dinda * * Prescience Lab, Dept. of Computer.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 16 Scheduling II.
1 Web Server Performance in a WAN Environment Vincent W. Freeh Computer Science North Carolina State Vsevolod V. Panteleenko Computer Science & Engineering.
Simulation Evaluation of Hybrid SRPT Policies
Web Server Request Scheduling Mingwei Gong Department of Computer Science University of Calgary November 16, 2004.
The War Between Mice and Elephants Presented By Eric Wang Liang Guo and Ibrahim Matta Boston University ICNP
Maryam Elahi Fairness in Speed Scaling Design Joint work with: Carey Williamson and Philipp Woelfel.
CENG 334 – Operating Systems 05- Scheduling
Operating Systems 1 K. Salah Module 2.1: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
1 Mor Harchol-Balter Carnegie Mellon University School of Computer Science.
CS 3013 & CS 502 Summer 2006 Scheduling1 The art and science of allocating the CPU and other resources to processes.
Chapter 6: CPU Scheduling. 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Chapter 6: CPU Scheduling Basic.
Effects and Implications of File Size/Service Time Correlation on Web Server Scheduling Policies Dong Lu* + Peter Dinda* Yi Qiao* Huanyuan Sheng* *Northwestern.
Looking at the Server-side of P2P Systems Yi Qiao, Dong Lu, Fabian E. Bustamante and Peter A. Dinda Department of Computer Science Northwestern University.
1 Connection Scheduling in Web Servers Mor Harchol-Balter School of Computer Science Carnegie Mellon
A Switch-Based Approach to Starvation in Data Centers Alex Shpiner Joint work with Isaac Keslassy Faculty of Electrical Engineering Faculty of Electrical.
Wk 2 – Scheduling 1 CS502 Spring 2006 Scheduling The art and science of allocating the CPU and other resources to processes.
The War Between Mice and Elephants By Liang Guo (Graduate Student) Ibrahim Matta (Professor) Boston University ICNP’2001 Presented By Preeti Phadnis.
Carnegie Mellon University Computer Science Department 1 CLASSIFYING SCHEDULING POLICIES WITH RESPECT TO HIGHER MOMENTS OF CONDITIONAL RESPONSE TIME Adam.
Job scheduling Queue discipline.
1 Mor Harchol-Balter Carnegie Mellon University Joint work with Bianca Schroeder.
1Chapter 05, Fall 2008 CPU Scheduling The CPU scheduler (sometimes called the dispatcher or short-term scheduler): Selects a process from the ready queue.
RAQFM – a Resource Allocation Queueing Fairness Measure David Raz School of Computer Science, Tel Aviv University Jointly with Hanoch Levy, Tel Aviv University.
Efficient Scheduling of Heterogeneous Continuous Queries Mohamed A. Sharaf Panos K. Chrysanthis Alexandros Labrinidis Kirk Pruhs Advanced Data Management.
1 SCHEDULING FOR TODAY’S COMPUTER SYSTEMS: SCHEDULING FOR TODAY’S COMPUTER SYSTEMS: BRIDGING THEORY AND PRACTICE Adam Wierman Mor Harchol-Balter John.
Advanced Network Architecture Research Group 2001/11/149 th International Conference on Network Protocols Scalable Socket Buffer Tuning for High-Performance.
CPU Scheduling Chapter 6 Chapter 6.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-3 CPU Scheduling Department of Computer Science and Software Engineering.
CSC 360- Instructor: K. Wu CPU Scheduling. CSC 360- Instructor: K. Wu Agenda 1.What is CPU scheduling? 2.CPU burst distribution 3.CPU scheduler and dispatcher.
Introduction and Overview Questions answered in this lecture: What is an operating system? How have operating systems evolved? Why study operating systems?
1 Mor Harchol-Balter Carnegie Mellon University Computer Science Heavy Tails: Performance Models & Scheduling Disciplines.
1 Scheduling Processes. 2 Processes Each process has state, that includes its text and data, procedure call stack, etc. This state resides in memory.
Chapter 5 – CPU Scheduling (Pgs 183 – 218). CPU Scheduling  Goal: To get as much done as possible  How: By never letting the CPU sit "idle" and not.
Scheduling. Alternating Sequence of CPU And I/O Bursts.
CS 3204 Operating Systems Godmar Back Lecture 13.
CPU Scheduling CSCI 444/544 Operating Systems Fall 2008.
1 Our focus  scheduling a single CPU among all the processes in the system  Key Criteria: Maximize CPU utilization Maximize throughput Minimize waiting.
Alternating Sequence of CPU And I/O Bursts. Histogram of CPU-burst Times.
1 The Effect of Heavy-Tailed Job Size Distributions on System Design Mor Harchol-Balter MIT Laboratory for Computer Science.
Advanced Network Architecture Research Group 2001/11/74 th Asia-Pacific Symposium on Information and Telecommunication Technologies Design and Implementation.
Carnegie Mellon University Computer Science Department 1 OPEN VERSUS CLOSED: A CAUTIONARY TALE Bianca Schroeder Adam Wierman Mor Harchol-Balter Computer.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Lecture 7: CPU Scheduling Chapter 5.
Lecture 7: Scheduling preemptive/non-preemptive scheduler CPU bursts
Uniprocessor Scheduling
1 Admission Control and Request Scheduling in E-Commerce Web Sites Sameh Elnikety, EPFL Erich Nahum, IBM Watson John Tracey, IBM Watson Willy Zwaenepoel,
Operating Systems 1 K. Salah Module 2.2: CPU Scheduling Scheduling Types Scheduling Criteria Scheduling Algorithms Performance Evaluation.
Scheduling. Main Points Scheduling policy: what to do next, when there are multiple threads ready to run – Or multiple packets to send, or web requests.
1 Part VII Component-level Performance Models for the Web © 1998 Menascé & Almeida. All Rights Reserved.
ITFN 2601 Introduction to Operating Systems Lecture 4 Scheduling.
Analysis of SRPT Scheduling: Investigating Unfairness Nikhil Bansal (Joint work with Mor Harchol-Balter)
Lecture Topics: 11/15 CPU scheduling: –Scheduling goals and algorithms.
1 Mor Harchol-Balter Carnegie Mellon with Nikhil Bansal with Bianca Schroeder with Mukesh Agrawal.
CPU Scheduling Operating Systems CS 550. Last Time Deadlock Detection and Recovery Methods to handle deadlock – Ignore it! – Detect and Recover – Avoidance.
Operating Systems Scheduling. Scheduling Short term scheduler (CPU Scheduler) –Whenever the CPU becomes idle, a process must be selected for execution.
Lecture 4 CPU scheduling. Basic Concepts Single Process  one process at a time Maximum CPU utilization obtained with multiprogramming CPU idle :waiting.
Lecture 12 Scheduling Models for Computer Networks Dr. Adil Yousif.
CPU scheduling.  Single Process  one process at a time  Maximum CPU utilization obtained with multiprogramming  CPU idle :waiting time is wasted 2.
3. CPU Scheduling. CPU Scheduling Process execution – a cycle of CPU execution and I/O wait – figure Preemptive Non-Preemptive.
Scheduling Adapted from:
Admission Control and Request Scheduling in E-Commerce Web Sites
Size-Based Scheduling Policies with Inaccurate Scheduling Information
Scheduling 21 May 2019.
Mean Delay Analysis of Multi Level Processor Sharing Disciplines
Don Porter Portions courtesy Emmett Witchel
FAIRNESS IN QUEUES Adam Wierman Carnegie Mellon University cmu
Presentation transcript:

1 Mor Harchol-Balter Carnegie Mellon University School of Computer Science

2 “size” = service requirement load  < 1 Q: Which minimizes mean response time?

3 “size” = service requirement jobs SRPT jobs load  < 1 jobs PS FCFS Q: Which best represents scheduling in web servers ?

4 IDEA How about using SRPT instead of PS in web servers? Linux 0.S. WEB SERVER (Apache) client 1 client 2 client 3 “Get File 1” “Get File 2” “Get File 3” Internet

5 Many servers receive mostly static web requests. “GET FILE” For static web requests, know file size Approx. know service requirement of request. Immediate Objections 1) Can’t assume known job size 2) But the big jobs will starve...

6 Outline of Talk [Sigmetrics 01] “Analysis of SRPT: Investigating Unfairness” [Performance 02] “Asymptotic Convergence of Scheduling Policies…” [Sigmetrics 03*] “Classifying Scheduling Policies wrt Unfairness …” THEORY IMPLEMENT [TOCS 03] “Size-based Scheduling to Improve Web Performance” [ITC 03*, TOIT 06] “Web servers under overload: How scheduling helps” [ICDE 04,05,06] “Priority Mechanisms for OLTP and Web Apps” (M/G/1) Schroeder Wierman IBM/CMU Patent

7 THEORY SRPT has a long history Schrage & Miller derive M/G/1/SRPT response time: 1968 Schrage proves optimality 1979 Pechinkin & Solovyev & Yashkov generalize 1990 Schassberger derives distribution on queue length BUT WHAT DOES IT ALL MEAN?

8 THEORY SRPT has a long history (cont.) year long study at Univ. of Aachen under Schreiber SRPT WINS BIG ON MEAN! 1998, 1999 Slowdown for SRPT under adversary: Rajmohan, Gehrke, Muthukrishnan, Rajaraman, Shaheen, Bender, Chakrabarti, etc. SRPT STARVES BIG JOBS! Various o.s. books: Silberschatz, Stallings, Tannenbaum: Warn about starvation of big jobs... Kleinrock’s Conservation Law: “Preferential treatment given to one class of customers is afforded at the expense of other customers.”

9 Unfairness Question SRPT PS ? ? Let  =0.9. Let G: Bounded Pareto(  = 1.1, max=10 10 ) Question: Which queue does biggest job prefer? M/G/1 THEORY

10 Results on Unfairness Let  =0.9. Let G: Bounded Pareto(  = 1.1, max=10 10 ) SRPT PS I SRPT

11 Unfairness – General Distribution All-can-win-theorem: For all distributions, if   ½, E[T(x)] SRPT  E[T(x)] PS for all x.

12 All-can-win-theorem: For all distributions, if   ½, E[T(x)] SRPT  E[T(x)] PS for all x. Proof idea:    x t dt 0 )1   )   x xFx 2 2 ))1(2 (  0  x dttft 2 )( Waiting time (SRPT)Residence (SRPT)Total (PS)

13 Classification of Scheduling Policies Always Unfair Sometimes Unfair Always Fair SRPT Age- Based Policies Preemptive Size-based Policies Remaining Size-based Policies Non- preemptive PS PLCFS FB PSJF LRPT FCFS LJF SJF FSP [Sigmetrics 01, 03] [Sigmetrics 04] Henderson FSP (Cornell) (both FAIR & efficient) Levy’s RAQFM (Tel Aviv) (size + temporal fairness) Biersack’s, Bonald’s flow fairness (France) Nunez, Borst TCP/DPS fairness (EURANDOM)

14 What does SRPT mean within a Web server? Many devices: Where to do the scheduling? No longer one job at a time. IMPLEMENT From theory to practice:

15 Server’s Performance Bottleneck IMPLEMENT 5 Linux 0.S. WEB SERVER (Apache) client 1 client 2 client 3 “Get File 1” “Get File 2” “Get File 3” Rest of Internet ISP Site buys limited fraction of ISP’s bandwidth We model bottleneck by limiting bandwidth on server’s uplink.

16 Network/O.S. insides of traditional Web server Sockets take turns draining --- FAIR = PS. Web Server Socket 1 Socket 3 Socket 2 Network Card Client1 Client3 Client2 BOTTLENECK IMPLEMENT

17 Network/O.S. insides of our improved Web server Socket corresponding to file with smallest remaining data gets to feed first. Web Server Socket 1 Socket 3 Socket 2 Network Card Client1 Client3 Client2 priority queues. 1 st 2 nd 3 rd S M L BOTTLENECK IMPLEMENT

18 Experimental Setup Implementation SRPT-based scheduling: 1) Modifications to Linux O.S.: 6 priority Levels 2) Modifications to Apache Web server 3) Priority algorithm design. Linux 0.S APACHE WEB SERVER Linux Linux Linux switch WAN EMU

19 Experimental Setup APACHE WEB SERVER Linux 0.S Linux Linux Linux switch WAN EMU Trace-based workload: Number requests made: 1,000,000 Size of file requested: 41B -- 2 MB Distribution of file sizes requested has HT property. Flash Apache WAN EMU Geographically- dispersed clients 10Mbps uplink 100Mbps uplink Surge Trace-based Open system Partly-open Load < 1 Transient overload + Other effects: initial RTO; user abort/reload; persistent connections, etc.

20 Preliminary Comments Job throughput, byte throughput, and bandwidth utilization were same under SRPT and FAIR scheduling. Same set of requests complete. No additional CPU overhead under SRPT scheduling. Network was bottleneck in all experiments. APACHE WEB SERVER Linux 0.S Linux Linux Linux switch WAN EMU

21 Load FAIR SRPT Mean Response Time (sec) Results: Mean Response Time (LAN)......

22 Percentile of Request Size Mean Response time (  s) FAIR SRPT Load =0.8 Mean Response Time vs. Size Percentile (LAN)

23 Transient Overload      

24 Transient Overload - Baseline Mean response time SRPT FAIR

25 Transient overload Response time as function of job size small jobs win big! big jobs aren’t hurt! FAIR SRPT WHY?

26 Baseline Case WAN propagation delays WAN loss Persistent Connections Initial RTO value SYN Cookies User Abort/Reload Packet Length Realistic Scenario WAN loss + delay RTT: 0 – 150 ms Loss: 0 – 15% RTT: 0 – 150 ms, 0 – 10 requests/conn. RTO = 0.5 sec – 3 sec ON/OFF Abort after 3 – 15 sec, with 2,4,6,8 retries. Packet length = 536 – 1500 Bytes RTT = 100 ms; Loss = 5%; 5 requests/conn., RTO = 3 sec; pkt len = 1500B; User aborts After 7 sec and retries up to 3 times. FACTORS

27 Transient Overload - Realistic Mean response time FAIR SRPT

28 More questions … STATIC web requests Everything so far in talk … DYNAMIC web requests Current work… (ICDE 04,05,06) Schroeder McWherter Schroeder Wierman

29 Online Shopping Internet client 1 client 2 client 3 “buy” Web Server (eg: Apache/Linux) Database (eg: DB2, Oracle, PostgreSQL) Dynamic responses take much longer – 10sec Database is bottleneck.

30 Online Shopping Internet client 1 client 2 client 3 “$$$buy$$$” “buy” Web Server (eg: Apache/Linux) Database (eg: DB2, Oracle, PostgreSQL) Goal: Prioritize requests

31 Isn’t “prioritizing requests” problem already solved? Internet “$$$buy$$$” “buy” Web Server (eg: Apache/Linux) Database (eg: DB2, Oracle, PostgreSQL) No. Prior work is simulation or RTDBMS.

32 Which resource to prioritize? “$$$buy$$$” “buy” Web Server (eg: Apache/Linux) Internet Database Disks Locks CPU(s) High-Priority clientLow-Priority client

33 Q: Which resource to prioritize? “$$$buy$$$” “buy” Web Server (eg: Apache/Linux) Internet Database Disks Locks CPU(s) High-Priority clientLow-Priority client A: 2PL  Lock Queues

34 What is bottleneck resource? IBM DB2 -- Lock waiting time (yellow) is bottleneck. Therefore, need to schedule lock queues to have impact. Fix at 10 warehouses #clients = 10 x #warehouses

35 Existing Lock scheduling policies Lock resource 1 HHLLLHHLLL Lock resource 2 NP  Non-preemptive. Can’t kick out lock holder. NPinherit  NP + Inheritance. Pabort  Preemptively abort. But suffer rollback cost + wasted work.

36 Results: Think time Non-preemptive policies High Low Think time Response Time (sec) Low High Response Time (sec) Preemptive-abort policy New idea: POW (Preempt-on-Wait) Preempt selectively: only preempt those waiting.

37 Results: Think time (sec) Response Time (sec) Pabort NPinherit Pabort NPinherit POW: Best of both IBM/CMU patent

38 External DBMS scheduling DBMS (eg: DB2, Oracle) QoS Internet “$$$buy$$$” “buy” Web Server Scheduling H L LL

39 Scheduling is a very cheap solution… No need to buy new hardware No need to buy more memory Small software modifications …with a potentially very big win. Conclusion Thank you!