Скачать презентацию Mor Harchol-Balter Carnegie Mellon University School of Computer Скачать презентацию Mor Harchol-Balter Carnegie Mellon University School of Computer

4466db1a00aac946c6cd78c063ae0c93.ppt

  • Количество слайдов: 39

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

Q: Which minimizes mean response time? jobs FCFS “size” = service requirement load r Q: Which minimizes mean response time? jobs FCFS “size” = service requirement load r < 1 jobs PS jobs SRPT 2

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

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

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

Outline of Talk THEORY Wierman (M/G/1) [Sigmetrics 01] “Analysis of SRPT: Investigating Unfairness” [Performance Outline of Talk THEORY Wierman (M/G/1) [Sigmetrics 01] “Analysis of SRPT: Investigating Unfairness” [Performance 02] “Asymptotic Convergence of Scheduling Policies…” [Sigmetrics 03*] “Classifying Scheduling Policies wrt Unfairness …” Schroeder 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” IBM/CMU www. cs. cmu. edu/~harchol/ Patent 6

THEORY SRPT has a long history. . . 1966 Schrage & Miller derive M/G/1/SRPT THEORY SRPT has a long history. . . 1966 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? 7

THEORY SRPT has a long history (cont. ) 1990 - 97 7 -year long THEORY SRPT has a long history (cont. ) 1990 - 97 7 -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. ” 8

THEORY Unfairness Question Let r=0. 9. Let G: Bounded Pareto(a = 1. 1, max=1010) THEORY Unfairness Question Let r=0. 9. Let G: Bounded Pareto(a = 1. 1, max=1010) ? PS M/G/1 ? Question: Which queue does biggest job prefer? SRPT M/G/1 9

Results on Unfairness Let r=0. 9. Let G: Bounded Pareto(a = 1. 1, max=1010) Results on Unfairness Let r=0. 9. Let G: Bounded Pareto(a = 1. 1, max=1010) I SRPT PS SRPT 10

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

All-can-win-theorem: For all distributions, if r < ½, E[T(x)]SRPT £ E[T(x)]PS for all x. All-can-win-theorem: For all distributions, if r < ½, E[T(x)]SRPT £ E[T(x)]PS for all x. Proof idea: x 2 + l x F ( x) l ò t f (t ) dt 2 0 2(1 - r ( x)) 2 Waiting time (SRPT) x + dt ò 1 - r (t ) 0 Residence (SRPT) Total (PS) 12

Classification of Scheduling Policies PS FSP PLCFS Always Fair FB Preemptive Size-based Policies PSJF Classification of Scheduling Policies PS FSP PLCFS Always Fair FB Preemptive Size-based Policies PSJF Age. Based Policies Always Unfair LRPT Remaining Size-based Policies SRPT [Sigmetrics 01, 03] [Sigmetrics 04] • • FCFS Nonpreemptive Sometimes Unfair LJF • • 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) SJF 13

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

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

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

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

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

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

1 2 3 200 Linux WAN EMU Preliminary Comments 1 APACHE WEB 2 SERVER 1 2 3 200 Linux WAN EMU Preliminary Comments 1 APACHE WEB 2 SERVER 3 switch Linux 0. S. • 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. 20

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

Mean Response time (ms) Mean Response Time vs. Size Percentile (LAN) Load =0. 8 Mean Response time (ms) Mean Response Time vs. Size Percentile (LAN) Load =0. 8 FAIR SRPT Percentile of Request Size 22

Transient Overload r>1 r<1 r>1 r<1 23 Transient Overload r>1 r<1 r>1 r<1 23

Transient Overload - Baseline Mean response time FAIR SRPT 24 Transient Overload - Baseline Mean response time FAIR SRPT 24

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

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

Transient Overload - Realistic Mean response time FAIR SRPT 27 Transient Overload - Realistic Mean response time FAIR SRPT 27

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

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

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

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

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

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

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

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

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

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

External DBMS scheduling “$$$buy$$$” “buy” Internet Web Server Qo. S DBMS (eg: DB 2, External DBMS scheduling “$$$buy$$$” “buy” Internet Web Server Qo. S DBMS (eg: DB 2, Oracle) “buy” L L H L Scheduling 38

Conclusion Scheduling is a very cheap solution… No need to buy new hardware No Conclusion 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. Thank you! 39